summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/LoopSimplify.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* eliminate RegisterOpt. It does the same thing as RegisterPass.Chris Lattner2006-08-271-1/+1
| | | | llvm-svn: 29925
* s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|Chris Lattner2006-08-271-1/+1
| | | | 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
* Use hidden visibility to make symbols in an anonymous namespace getChris Lattner2006-06-281-1/+2
| | | | | | dropped. This shrinks libllvmgcc.dylib another 67K llvm-svn: 28975
* Canonicalize inner loops before outer loops. Inner loop canonicalizationChris Lattner2006-02-141-4/+5
| | | | | | | | can provide work for the outer loop to canonicalize. This fixes a case that breaks unswitching. llvm-svn: 26189
* When splitting exit edges to canonicalize loops, make sure to put the newChris Lattner2006-02-141-18/+20
| | | | | | | | block in the appropriate loop nest. Third time is the charm, right? llvm-svn: 26187
* Revert my last patch. It too breaks stuffChris Lattner2006-02-121-12/+6
| | | | llvm-svn: 26128
* Fix for my previously reverted patchChris Lattner2006-02-111-6/+12
| | | | llvm-svn: 26126
* revert my previous change, it exposed other problems.Chris Lattner2006-02-111-1/+1
| | | | llvm-svn: 26121
* Make this check stricter. Disallow loop exit blocks from being shared byChris Lattner2006-02-111-4/+7
| | | | | | loops and their subloops. llvm-svn: 26118
* remove dead exprChris Lattner2006-02-111-1/+0
| | | | llvm-svn: 26116
* Teach loopsimplify to update et-forest. Patch contributed by Daniel Berlin!Chris Lattner2006-01-091-0/+19
| | | | llvm-svn: 25153
* Update Visual Studio projects to reflect moved file.Jeff Cohen2005-10-261-0/+855
llvm-svn: 23998
OpenPOWER on IntegriCloud