summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
Commit message (Collapse)AuthorAgeFilesLines
* This case isn't implemented yet. It seems unlikely to be needed, but if itChris Lattner2006-10-041-4/+2
| | | | | | ever is, we want to get an assert instead of silent bad codegen. llvm-svn: 30716
* Fix PR932 and Analysis/Dominators/2006-10-02-BreakCritEdges.ll:Chris Lattner2006-10-031-15/+112
| | | | | | | The critical edge block dominates the dest block if the destblock dominates all edges other than the one incoming from the critical edge. llvm-svn: 30696
* simplify codeChris Lattner2006-09-281-1/+1
| | | | llvm-svn: 30656
* Be far more careful when splitting a loop header, either to form a preheaderChris Lattner2006-09-231-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | or when splitting loops with a common header into multiple loops. In particular the old code would always insert the preheader before the old loop header. This is disasterous in cases where the loop hasn't been rotated. For example, it can produce code like: .. outside the loop... jmp LBB1_2 #bb13.outer LBB1_1: #bb1 movsd 8(%esp,%esi,8), %xmm1 mulsd (%edi), %xmm1 addsd %xmm0, %xmm1 addl $24, %edi incl %esi jmp LBB1_3 #bb13 LBB1_2: #bb13.outer leal (%edx,%eax,8), %edi pxor %xmm1, %xmm1 xorl %esi, %esi LBB1_3: #bb13 movapd %xmm1, %xmm0 cmpl $4, %esi jl LBB1_1 #bb1 Note that the loop body is actually LBB1_1 + LBB1_3, which means that the loop now contains an uncond branch WITHIN it to jump around the inserted loop header (LBB1_2). Doh. This patch changes the preheader insertion code to insert it in the right spot, producing this code: ... outside the loop, fall into the header ... LBB1_1: #bb13.outer leal (%edx,%eax,8), %esi pxor %xmm0, %xmm0 xorl %edi, %edi jmp LBB1_3 #bb13 LBB1_2: #bb1 movsd 8(%esp,%edi,8), %xmm0 mulsd (%esi), %xmm0 addsd %xmm1, %xmm0 addl $24, %esi incl %edi LBB1_3: #bb13 movapd %xmm0, %xmm1 cmpl $4, %edi jl LBB1_2 #bb1 Totally crazy, no branch in the loop! :) llvm-svn: 30587
* Teach UpdateDomInfoForRevectoredPreds to handle revectored preds that are notChris Lattner2006-09-231-91/+49
| | | | | | | | reachable, making it general purpose enough for use by InsertPreheaderForLoop. Eliminate custom dominfo updating code in InsertPreheaderForLoop, using UpdateDomInfoForRevectoredPreds instead. llvm-svn: 30586
* Second half of the fix for Transforms/Inline/inline_cleanup.llChris Lattner2006-09-131-2/+28
| | | | | | | This folds unconditional branches that are often produced by code specialization. llvm-svn: 30307
* Implement the first half of Transforms/Inline/inline_cleanup.llChris Lattner2006-09-131-1/+9
| | | | llvm-svn: 30303
* Fix Duraid's changes to work when TLI is null. This fixes the failingChris Lattner2006-09-051-3/+7
| | | | | | lowerinvoke regtests. llvm-svn: 30115
* add setJumpBufSize() and setJumpBufAlignment() to target-lowering.Duraid Madina2006-09-041-10/+10
| | | | | | | Call these from your backend to enjoy setjmp/longjmp goodness, see lib/Target/IA64/IA64ISelLowering.cpp for an example llvm-svn: 30095
* eliminate RegisterOpt. It does the same thing as RegisterPass.Chris Lattner2006-08-279-9/+9
| | | | llvm-svn: 29925
* s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|Chris Lattner2006-08-277-7/+7
| | | | llvm-svn: 29911
* Don't attempt to split subloops out of a loop with a huge number of backedges.Chris Lattner2006-08-121-8/+19
| | | | | | | | | Not only will this take huge amounts of compile time, the resultant loop nests won't be useful for optimization. This reduces loopsimplify time on Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll from ~32s to ~0.4s with a debug build of llvm on a 2.7Ghz G5. llvm-svn: 29647
* Reimplement the loopsimplify code which deletes edges from unreachableChris Lattner2006-08-121-29/+53
| | | | | | | | | | | | | | | | | | | blocks that target loop blocks. Before, the code was run once per loop, and depended on the number of predecessors each block in the loop had. Unfortunately, scanning preds can be really slow when huge numbers of phis exist or when phis with huge numbers of inputs exist. Now, the code is run once per function and scans successors instead of preds, which is far faster. In addition, the new code is simpler and is goto free, woo. This change speeds up a nasty testcase Duraid provided me from taking hours to taking ~72s with a debug build. The functionality this implements is already tested in the testsuite as Transforms/CodeExtractor/2004-03-13-LoopExtractorCrash.ll. llvm-svn: 29644
* Fix PR867 (and maybe 868) and testcsae:Chris Lattner2006-08-031-6/+25
| | | | | | Transforms/SimplifyCFG/2006-08-03-Crash.ll llvm-svn: 29515
* Add special check to avoid isLoop call. Simple, but doesn't seem to speedChris Lattner2006-08-021-2/+2
| | | | | | up lcssa much in practice. llvm-svn: 29465
* Replace the SSA update code in LCSSA with a bottom-up approach instead of a topChris Lattner2006-08-021-125/+95
| | | | | | | | | | | | | | | | | down approach, inspired by discussions with Tanya. This approach is significantly faster, because it does not need dominator frontiers and it does not insert extraneous unused PHI nodes. For example, on 252.eon, in a release-asserts build, this speeds up LCSSA (which is the slowest pass in gccas) from 9.14s to 0.74s on my G5. This code is also slightly smaller and significantly simpler than the old code. Amusingly, in a normal Release build (which includes the "assert(L->isLCSSAForm());" assertion), asserting that the result of LCSSA is in LCSSA form is actually slower than the LCSSA transformation pass itself on 252.eon. I will see if Loop::isLCSSAForm can be sped up next. llvm-svn: 29463
* Add some adviceChris Lattner2006-07-275-0/+1230
| | | | llvm-svn: 29324
* silence warnings in a release buildChris Lattner2006-07-181-1/+1
| | | | llvm-svn: 29189
* eliminate some ugly code, using ConstantExpr::getWithOperands instead.Chris Lattner2006-07-141-35/+4
| | | | llvm-svn: 29149
* Handle instructions in the map, but that map to a null pointer.Chris Lattner2006-07-121-1/+2
| | | | | | This unbreaks smg2000. llvm-svn: 29127
* In addition to deleting calls, the inliner can constant fold them as well.Chris Lattner2006-07-121-2/+4
| | | | | | | Handle this case, which doesn't require a new callgraph edge. This fixes a crash compiling MallocBench/gs. llvm-svn: 29121
* Change the callgraph representation to store the callsite along with theChris Lattner2006-07-121-37/+46
| | | | | | | | | | | target CG node. This allows the inliner to properly update the callgraph when using the pruning inliner. The pruning inliner may not copy over all call sites from a callee to a caller, so the edges corresponding to those call sites should not be copied over either. This fixes PR827 and Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll llvm-svn: 29120
* Fix typo in the comment.Owen Anderson2006-07-091-1/+1
| | | | llvm-svn: 29078
* Add a fix for an issue where LCSSA would fail to insert undef's in some cornerOwen Anderson2006-07-091-14/+21
| | | | | | | cases. Ideally, this issue will go away in the future as LCSSA gets smarter about which Phi nodes it inserts. llvm-svn: 29076
* Use hidden visibility to make symbols in an anonymous namespace getChris Lattner2006-06-283-3/+6
| | | | | | dropped. This shrinks libllvmgcc.dylib another 67K llvm-svn: 28975
* Use the PotDoms map to memoize 'dominating value' lookup. With this patch,Chris Lattner2006-06-141-17/+14
| | | | | | | LCSSA is still the slowest pass when gccas'ing 252.eon, but now it only takes 39s instead of 289s. :) llvm-svn: 28776
* Fix another instance where PHI nodes need special treatment.Owen Anderson2006-06-131-0/+6
| | | | llvm-svn: 28774
* Fix a bug that was causing major slowdowns in povray. This was due to LCSSAOwen Anderson2006-06-131-2/+7
| | | | | | | | | not handling PHI nodes correctly when determining if a value was live-out. This patch reduces the number of detected live-out variables in the testcase from 6565 to 485. llvm-svn: 28771
* Fix an infinite loop on Transforms/SimplifyCFG/2006-06-12-InfLoop.llChris Lattner2006-06-121-1/+10
| | | | llvm-svn: 28758
* Fix for 2006-06-26-MultipleExitsSingleBlock.Owen Anderson2006-06-121-4/+7
| | | | | | | | If a single exit block has multiple predecessors within the loop, it will appear in the exit blocks list more than once. LCSSA needs to take that into account so that it doesn't double process that exit block. llvm-svn: 28750
* Re-commit the safe parts of my 6/9 patch. Still working on fixing the ↵Owen Anderson2006-06-111-0/+2
| | | | | | unsafe parts. llvm-svn: 28748
* Back out Owen's 6/9 changes. They broke ↵Evan Cheng2006-06-111-3/+1
| | | | | | MultiSource/Benchmarks/Prolangs-C/bison (and perhaps others). llvm-svn: 28747
* Make Loop able to verify that it is in LCSSA-form, and have the LCSSA pass ↵Owen Anderson2006-06-091-1/+3
| | | | | | | | assert on this. llvm-svn: 28738
* Update some comments, and expose LCSSAID in preparation for having other passesOwen Anderson2006-06-081-1/+8
| | | | | | require LCSSA. llvm-svn: 28734
* Fix some formatting, and use inLoop() when appropriate.Owen Anderson2006-06-061-3/+3
| | | | llvm-svn: 28694
* Stop a memory leak, and update some comments.Owen Anderson2006-06-061-10/+10
| | | | llvm-svn: 28693
* Some more clean-up, and squash an IDF-Phi related bug.Owen Anderson2006-06-041-16/+13
| | | | llvm-svn: 28680
* Various clean-ups suggested by Chris.Owen Anderson2006-06-041-30/+32
| | | | llvm-svn: 28678
* Fix a bug in Phi-noded insertion. Also, update some comments to reflect what'sOwen Anderson2006-06-031-12/+21
| | | | | | actually going on. llvm-svn: 28677
* Force anything that #includes llvm/Transforms/Utils/UnifyFunctionExitNodes.hChris Lattner2006-06-021-0/+2
| | | | | | | to link in the implementation. Thanks to Anton Korobeynikov for figuring out what was going on here. llvm-svn: 28660
* Remove dead #includeChris Lattner2006-06-011-2/+0
| | | | llvm-svn: 28642
* Make the "pruning cloner" smarter. As it propagates constants through theChris Lattner2006-06-011-23/+146
| | | | | | | | | | code (while cloning) it often gets the branch/switch instructions. Since it knows that edges of the CFG are dead, it need not clone (or even look) at the obviously dead blocks. This should speed up the inliner substantially on code where there are lots of inlinable calls to functions with constant arguments. On C++ code in particular, this kicks in. llvm-svn: 28641
* Remove a FIXME that was fixed with my last patch.Owen Anderson2006-06-011-2/+0
| | | | llvm-svn: 28619
* More cleanups. Also, add a special case for updating PHI nodes, andOwen Anderson2006-06-011-21/+33
| | | | | | | reimplement getValueDominatingFunction to walk the DominanceTree rather than just searching blindly. llvm-svn: 28618
* Extract a huge loop into a helper method. Fix a few iterator-invalidation bugs.Owen Anderson2006-05-311-86/+113
| | | | llvm-svn: 28599
* Add Use replacement. Assuming there is nothing horribly wrong with this, LCSSAOwen Anderson2006-05-291-2/+35
| | | | | | | is now theoretically feature-complete. It has not, however, been thoroughly test, and is still considered experimental. llvm-svn: 28529
* Major think-o. Iterate over all live out-of-loop values, and perform theOwen Anderson2006-05-281-36/+36
| | | | | | | other calculations on each individually, rather than trying to delay it and do them all at the end. llvm-svn: 28527
* Make LCSSA insert proper Phi nodes throughout the rest of the CFG by computingOwen Anderson2006-05-271-8/+51
| | | | | | | | the iterated Dominance Frontier of the loop-closure Phi's. This is the second phase of the LCSSA pass. The third phase (coming soon) will be to update all uses of loop variables to use the loop-closure Phi's instead. llvm-svn: 28524
* Fix some regression from the inliner patch I committed last night. This fixesChris Lattner2006-05-271-1/+1
| | | | | | ldecod, lencod, and SPASS. llvm-svn: 28523
* Switch the inliner over to using CloneAndPruneFunctionInto. This effectivelyChris Lattner2006-05-271-5/+9
| | | | | | | | | | | | | | | | | | | | | | | makes it so that it constant folds instructions on the fly. This is good for several reasons: 0. Many instructions are constant foldable after inlining, particularly if inlining a call with constant arguments. 1. Without this, the inliner has to allocate memory for all of the instructions that can be constant folded, then a subsequent pass has to delete them. This gets the job done without this extra work. 2. This makes the inliner *pass* a bit more aggressive: in particular, it partially solves a phase order issue where the inliner would inline lots of code that folds away to nothing, but think that the resultant function is big because of this code that will be gone. Now the code never exists. This is the first part of a 2-step process. The second part will be smart enough to see when this implicit constant folding propagates a constant into a branch or switch instruction, making CFG edges dead. This implements Transforms/Inline/inline_constprop.ll llvm-svn: 28521
OpenPOWER on IntegriCloud