summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* teach ipsccp and ipconstprop that a blockaddress doesn't 'take the address' ↵Chris Lattner2009-11-012-2/+7
| | | | | | | | | of a function in a way that should prevent ip constprop. This allows clang/test/CodeGen/indirect-goto.c to pass with the new indirect goto lowering. llvm-svn: 85709
* change llvm::MergeBlockIntoPredecessor to not merge two blocks BB1->BB2 Chris Lattner2009-11-011-3/+7
| | | | | | | | | when BB2 has its address taken. Since it ends up doing BB2->rauw(BB1), this can cause the address of the entry block to be taken. Since it is generally undesirable to nuke blocks whose address is taken, even when we can, just unconditionally stop this xform. llvm-svn: 85708
* strengthen an assumption: RevectorBlockTo knows that PredBB Chris Lattner2009-11-011-12/+14
| | | | | | | | ended in an uncond branch because the pass requires BreakCriticalEdges. However, BCE doesn't eliminate critical adges from indbrs. llvm-svn: 85707
* if CostMetrics says to never duplicate some code, don't unswitch a loop.Chris Lattner2009-11-011-1/+2
| | | | | | This prevents unswitching from duplicating indbr's. llvm-svn: 85705
* constant fold indirectbr(blockaddress(%bb)) -> br label %bb.Chris Lattner2009-11-011-9/+46
| | | | llvm-svn: 85704
* Revert 85678/85680. The decision is to stay with the current form of Chris Lattner2009-11-012-8/+4
| | | | | | | indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it for simplicity. llvm-svn: 85699
* Make sure PRE doesn't split crit edges from indirectbr.Chris Lattner2009-10-311-1/+5
| | | | llvm-svn: 85692
* llvm::SplitEdge should refuse to split an edge from an indirectbr.Chris Lattner2009-10-312-1/+4
| | | | | | Fix CodeGenPrepare to not try to split edges from indirectbr. llvm-svn: 85690
* update the comment above llvm::SplitCriticalEdge, and makeChris Lattner2009-10-311-6/+21
| | | | | | it abort on IndirectBrInst as describe in the comment. llvm-svn: 85688
* adjust a couple xforms to work with null bb's in BlockAddress.Chris Lattner2009-10-312-4/+8
| | | | llvm-svn: 85680
* add a comment.Chris Lattner2009-10-311-0/+4
| | | | llvm-svn: 85671
* Revert r85667. LoopUnroll currently can't call utility functions whichDan Gohman2009-10-312-24/+94
| | | | | | | auto-update the DominatorTree because it doesn't keep the DominatorTree current while it works. llvm-svn: 85670
* Remove redundant code.Dan Gohman2009-10-311-3/+0
| | | | llvm-svn: 85668
* Merge the enhancements from LoopUnroll's FoldBlockIntoPredecessor intoDan Gohman2009-10-312-94/+24
| | | | | | | MergeBlockIntoPredecessor. This makes SimplifyCFG slightly more aggressive, and makes it unnecessary for LoopUnroll to have its own copy of this code. llvm-svn: 85667
* Rename forgetLoopBackedgeTakenCount to forgetLoop, because itDan Gohman2009-10-313-3/+3
| | | | | | clears out more information than just the stored backedge taken count. llvm-svn: 85664
* Replace LoopUnrollPass.cpp's custom code-size estimation code usingDan Gohman2009-10-311-30/+5
| | | | | | the new common CodeMetrics code. llvm-svn: 85663
* Simplify this code.Dan Gohman2009-10-311-2/+2
| | | | llvm-svn: 85662
* Remove an unnecessary #include.Dan Gohman2009-10-311-1/+0
| | | | llvm-svn: 85661
* Update CMakeLists for recent renames.Dan Gohman2009-10-312-2/+2
| | | | llvm-svn: 85660
* Rename UnrollLoop.cpp to LoopUnroll.cpp, and LoopUnroll.cpp toDan Gohman2009-10-312-0/+0
| | | | | | | LoopUnrollPass.cpp, for consistency with other passes which are similarly split. llvm-svn: 85659
* Remove CodeGenLICM. It's largely obsoleted by MachineLICM's new abilityDan Gohman2009-10-312-113/+0
| | | | | | to unfold loop-invariant loads. llvm-svn: 85657
* Reapply r85634, with the bug fixed.Dan Gohman2009-10-311-15/+17
| | | | llvm-svn: 85655
* Revert 85634. It's breaking consumer-typeset (and others).Evan Cheng2009-10-311-17/+15
| | | | llvm-svn: 85641
* Add a comment about a missed opportunity.Dan Gohman2009-10-301-0/+5
| | | | llvm-svn: 85635
* Optimize around the fact that pred_iterator is slow: instead of sortingDan Gohman2009-10-301-15/+17
| | | | | | | PHI operands by the predecessor order, sort them by the order used by the first PHI in the block. This is still suffucient to expose duplicates. llvm-svn: 85634
* Teach SimplifyCFG how to eliminate duplicate PHI nodes within a block.Dan Gohman2009-10-301-0/+61
| | | | | | | This reduces codesize on a variety of codes by 1-2% on x86-64. It also helps clean up after SSAUpdater. llvm-svn: 85626
* Sort the incoming values in PHI nodes to match the predecessor order.Dan Gohman2009-10-301-0/+19
| | | | | | | This helps expose duplicate PHIs, which will make it easier for them to be eliminated. llvm-svn: 85623
* Add option to createGVNPass to disable PRE.Evan Cheng2009-10-301-2/+3
| | | | llvm-svn: 85609
* Apply some cleanups. No functionality changes.Nick Lewycky2009-10-291-27/+23
| | | | llvm-svn: 85498
* just for the hell of it, allow globalopt to statically evaluate Chris Lattner2009-10-291-0/+6
| | | | | | static constructors with indirect gotos :) llvm-svn: 85495
* teach various passes about blockaddress. We no longerChris Lattner2009-10-293-33/+57
| | | | | | crash on any clang tests. llvm-svn: 85465
* teach ValueMapper about BlockAddress', making bugpoint a lot more useful.Chris Lattner2009-10-291-7/+10
| | | | llvm-svn: 85458
* unindent massive blocks, no functionality change.Chris Lattner2009-10-291-69/+75
| | | | llvm-svn: 85457
* Extend getMallocArraySize() to determine the array size if the malloc ↵Victor Hernandez2009-10-281-11/+9
| | | | | | | | | | | | | | 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. llvm-svn: 85421
* llvm.dbg.global_variables do not exist anymore.Devang Patel2009-10-281-9/+0
| | | | llvm-svn: 85402
* No newline at end of file.Edward O'Callaghan2009-10-281-1/+1
| | | | llvm-svn: 85390
* Update CMake file.Benjamin Kramer2009-10-281-0/+1
| | | | llvm-svn: 85389
* Treat lifetime begin/end markers as allocations/frees respectively for theOwen Anderson2009-10-282-0/+41
| | | | | | purposes for GVN/DSE. llvm-svn: 85383
* Add ABCD, a generalized implementation of the Elimination of Array BoundsNick Lewycky2009-10-281-0/+1108
| | | | | | | | 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! llvm-svn: 85382
* Previously, all operands to Constant were themselves constant.Chris Lattner2009-10-281-5/+4
| | | | | | | | | 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. llvm-svn: 85375
* Factor out redundancy from clone() implementations.Devang Patel2009-10-272-2/+2
| | | | llvm-svn: 85327
* Rename MallocFreeHelper as MemoryBuiltinsVictor Hernandez2009-10-277-7/+7
| | | | llvm-svn: 85286
* Fix a pretty serious misfeature of the inliner: if it inlines a functionChris Lattner2009-10-271-0/+9
| | | | | | | | | | with multiple return values it inserts a PHI to merge them all together. However, if the return values are all the same, it ends up with a pointless PHI and this pointless PHI happens to really block SRoA from happening in at least a silly C++ example written by Doug, but probably others. This fixes rdar://7339069. llvm-svn: 85206
* VS build fix, patch by Marius Wachtler.Mike Stump2009-10-271-0/+1
| | | | llvm-svn: 85197
* Add objectsize intrinsic and hook it up through codegen. Doesn'tEric Christopher2009-10-271-0/+25
| | | | | | do anything than return "I don't know" at the moment. llvm-svn: 85189
* Add braces to avoid ambiguous else.Dan Gohman2009-10-271-1/+2
| | | | llvm-svn: 85185
* Rename MallocHelper as MallocFreeHelper, since it now also identifies calls ↵Victor Hernandez2009-10-267-7/+7
| | | | | | to free() llvm-svn: 85181
* Add a straight-forward implementation of SCCVN for aggressively eliminating ↵Owen Anderson2009-10-261-0/+721
| | | | | | scalar redundancies. llvm-svn: 85179
* Remove FreeInst.Victor Hernandez2009-10-269-183/+7
| | | | | | | Remove LowerAllocations pass. Update some more passes to treate free calls just like they were treating FreeInst. llvm-svn: 85176
* Simplify this code. LoopDeletion doesn't need to explicit check thatDan Gohman2009-10-261-24/+2
| | | | | | | the loop exiting block dominates the latch block; if ScalarEvolution can prove that the trip-count is finite, that's sufficient. llvm-svn: 85165
OpenPOWER on IntegriCloud