Commit Graph

53539 Commits

Author SHA1 Message Date
Dale Johannesen
78c5cdaf2a When there is a 2-instruction spill sequence, record
the second (store) instruction in SpillSlotToUsesMap
consistently.  I don't think this matters functionally,
but it's cleaner and Evan wants it this way.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85463 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 01:15:40 +00:00
Bill Wendling
8bedf97f68 Don't put in these EH changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:37:35 +00:00
Douglas Gregor
f25cf3d56f A switch-on-string-literal construct that is a nice alternative to
cascading "ifs" of strcmps/memcmps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85459 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:34:30 +00:00
Chris Lattner
1bb95911de teach ValueMapper about BlockAddress', making bugpoint a lot more useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85458 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:31:02 +00:00
Chris Lattner
77488ccc63 unindent massive blocks, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85457 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:28:30 +00:00
Bill Wendling
f58898fd41 Reverting r85338 for now. It's causing a bootstrap failure on PPC darwin9.
--- Reverse-merging r85338 into '.':
U    lib/CodeGen/SimpleRegisterCoalescing.cpp
U    lib/CodeGen/SimpleRegisterCoalescing.h



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85454 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:22:16 +00:00
Dan Gohman
6b3bd7bbde Add indirectbr and blockaddress to the vim syntax highlighting file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:14:44 +00:00
Dan Gohman
eeb8ef1f37 Add a hasAddressTaken for BasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85449 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:09:08 +00:00
Chris Lattner
a809d2fb27 add IRBuilder support for IndirectBr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 23:25:00 +00:00
Bob Wilson
2c04dae715 Reimplement BranchFolding change to avoid tail merging for a 1 instruction
common tail, except when the OptimizeForSize function attribute is present.
Radar 7338114.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85441 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 22:10:20 +00:00
Dale Johannesen
e841d2f867 When we generate spill code, then decide we don't need
to spill after all, we weren't handling 2-instruction
spill sequences correctly (PPC Altivec).  We need to
remove the store in this case.  Removing the other
instruction(s) would be goodness but is not needed for
correctness, and isn't done here.  7331562.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 21:56:18 +00:00
Eric Christopher
7e5d2ff20f Make sure we return the right sized type here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 21:32:16 +00:00
Bob Wilson
a597103c32 Revert r85346 change to control tail merging by CodeGenOpt::Level.
I'm going to redo this using the OptimizeForSize function attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 20:46:46 +00:00
Victor Hernandez
90f48e7c91 Extend getMallocArraySize() to determine the array size if the malloc argument is:
ArraySize * ElementSize
ElementSize * ArraySize
ArraySize << log2(ElementSize)
ElementSize << log2(ArraySize)

Refactor isArrayMallocHelper and delete isSafeToGetMallocArraySize, so that there is only 1 copy of the malloc array determining logic.
Update users of getMallocArraySize() to not bother calling isArrayMalloc() as well.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 20:18:55 +00:00
Viktor Kutuzov
5c00b4af61 Fix to pass options from Gold plugin to LTO codegen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85419 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 18:55:55 +00:00
Benjamin Kramer
74b691e4e4 Teach cmake that mk[sd]temp is defined in stdlib.h on some systems.
This fixes parallel build with clang on glibc platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 18:37:31 +00:00
David Goodwin
82c7248518 Make AntiDepReg.h internal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85412 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 18:29:54 +00:00
Bob Wilson
8d4de5abfa Add a Thumb BRIND pattern. Change the ARM BRIND assembly to separate the
opcode and operand with a tab.  Check for these instructions in the usual
places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85411 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 18:26:41 +00:00
Evan Cheng
30c80211b6 fconsts and fconstd are obviously re-materializable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 18:19:56 +00:00
Jim Grosbach
ca5dfb71ba Cleanup now that frame index scavenging via post-pass is working for ARM and Thumb2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 17:33:28 +00:00
Devang Patel
cd0fee86de llvm.dbg.global_variables do not exist anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 16:51:52 +00:00
Chris Lattner
70197a3a04 add a new 'SetCurrentDebugType' API (requested by Andrew Haley for JIT
stuff) to programmatically control the current debug flavor.  While 
I'm at it, doxygenate Debug.h and clean it up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 15:32:19 +00:00
Dan Gohman
1507cd03a6 Don't call SDNode::isPredecessorOf when it isn't necessary. If the load's
chains have no users, they can't be predecessors of the condition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85394 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 15:28:02 +00:00
Dan Gohman
b8457a1a29 Simplify this code: if the unfolded load can't be hoisted, just delete
the new instructions and leave the old one in place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85393 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 15:23:36 +00:00
Edward O'Callaghan
c359ec7021 No newline at end of file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85390 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 15:04:53 +00:00
Benjamin Kramer
3185d702f2 Update CMake file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85389 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 13:29:18 +00:00
Gabor Greif
a5b6f45b68 use metavariable <result> instead of SSA name %result for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85388 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 13:14:50 +00:00
Gabor Greif
ec58f75d7d ooops, SSA name should not be part of the link
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 13:05:07 +00:00
Gabor Greif
6a29201565 advertise new syntax for unnamed instructions
and eliminate confusing double-use of SSA names
(work in progress)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 09:21:30 +00:00
Owen Anderson
b62f792e78 Treat lifetime begin/end markers as allocations/frees respectively for the
purposes for GVN/DSE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85383 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 07:05:35 +00:00
Nick Lewycky
40cc524ede Add ABCD, a generalized implementation of the Elimination of Array Bounds
Checks on Demand algorithm which looks at arbitrary branches instead of loop
iterations. This is GSoC work by Andre Tavares with only editorial changes
applied!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85382 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 07:03:15 +00:00
Evan Cheng
c59420867e Give ARMISD::EH_SJLJ_LONGJMP and EH_SJLJ_SETJMP names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85381 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 06:55:03 +00:00
Owen Anderson
a85a66423d Be more careful about invariance reasoning on "store" queries. Stores still need
to depend on Ref and ModRef calls within the invariant region.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85380 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 06:30:52 +00:00
Evan Cheng
89321166da X86 palignr intrinsics immediate field is in bits. ISel must transform it into bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 06:30:34 +00:00
Owen Anderson
4bc737c5ef Add trivial support for the invariance intrinsics to memdep. This logic is
purely local for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85378 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 06:18:42 +00:00
Chris Lattner
50b136dae9 add bitcode reader support for blockaddress. We can now fully
round trip blockaddress through .ll and .bc files, so add a testcase.

There are still a bunch of places in the optimizer and other places
that need to be updated to work with these constructs, but at least
the basics are in now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 05:53:48 +00:00
Chris Lattner
837e04a8bf bitcode writer support for blockaddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 05:24:40 +00:00
Chris Lattner
0eeb913aa1 Previously, all operands to Constant were themselves constant.
In the new world order, BlockAddress can have a BasicBlock operand.
This doesn't permute much, because if you have a ConstantExpr (or
anything more specific than Constant) we still know the operand has
to be a Constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85375 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 05:14:34 +00:00
Chris Lattner
46b3abc9f7 doc bug spotted by apinski
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85372 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 04:47:06 +00:00
Chris Lattner
5d81befc21 'static const void *X = &&y' can only be put in the
readonly section if a reference to the containing function
is valid in the readonly section.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85370 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 04:12:16 +00:00
Dan Gohman
6688d61797 Rewrite SelectionDAG::isPredecessorOf to be iterative instead of
recursive to avoid consuming extraordinary amounts of stack space
when processing tall graphs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85369 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 03:44:30 +00:00
Chris Lattner
09d9ef4122 full asmparser support for blockaddress. We can now do:
$ llvm-as foo.ll -d -disable-output

which reads and prints the .ll file.  BC encoding is the
next project.  Testcase will go in once that works.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 03:39:23 +00:00
Chris Lattner
73050e1c38 asmprinter support for BlockAddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85367 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 03:38:12 +00:00
Chris Lattner
1e0dc8e123 when we tear down a module, we need to be careful to
zap BlockAddress values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85366 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 03:37:35 +00:00
Chris Lattner
6d013fc381 basic blocks can now have non-instruction users.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85365 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 03:36:44 +00:00
Dan Gohman
589f1f5a43 Teach MachineLICM to unfold loads from constant memory from
otherwise unhoistable instructions in order to allow the loads
to be hoisted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 03:21:57 +00:00
Evan Cheng
39382427f1 Use fconsts and fconstd to materialize small fp constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 01:44:26 +00:00
Evan Cheng
a1eaa3c52b Add a second ValueType argument to isFPImmLegal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 01:43:28 +00:00
Dan Gohman
a104d1eab2 Mark dead physregdefs dead immediately. This helps MachineSink and
MachineLICM and other things which run before LiveVariables is run.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 01:13:53 +00:00
Dan Gohman
83f6120c9a Allow constants of different types to share constant pool entries
if they have compatible encodings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 01:12:16 +00:00