summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Use hidden visibility to make symbols in an anonymous namespace getChris Lattner2006-06-286-7/+13
| | | | | | dropped. This shrinks libllvmgcc.dylib another 67K llvm-svn: 28975
* Shrink libllvmgcc.dylib by another 23KChris Lattner2006-06-285-6/+12
| | | | llvm-svn: 28972
* Switch to a very conservative heuristic for determining when loop-unswitchingOwen Anderson2006-06-281-5/+5
| | | | | | | | | | will be profitable. This is mainly to remove some cases where excessive unswitching would result in long compile times and/or huge generated code. Once someone comes up with a better heuristic that avoids these cases, this should be switched out. llvm-svn: 28962
* Fix Transforms/InstCombine/2006-06-28-infloop.llChris Lattner2006-06-281-0/+6
| | | | llvm-svn: 28961
* Don't unswitch really large loops even if they are mostly filled with emptyChris Lattner2006-06-281-0/+6
| | | | | | blocks. llvm-svn: 28959
* Catch more function pointer casting problemsAndrew Lenharth2006-06-281-1/+9
| | | | | | | | | Remove the Function pointer cast in these calls, converting it to a cast of argument. %tmp60 = tail call int cast (int (ulong)* %str to int (int)*)( int 10 ) %tmp60 = tail call int cast (int (ulong)* %str to int (int)*)( uint %tmp51 ) llvm-svn: 28953
* Fix for 2006-06-27-DeadSwitchCase.llOwen Anderson2006-06-271-5/+6
| | | | | | | Be more careful when updating Phi nodes after eliminating dead switch cases. Fix proposed by Chris. llvm-svn: 28947
* Fix Transforms/DeadArgElim/2006-06-27-struct-ret.ll. -deadargelim should notChris Lattner2006-06-271-5/+11
| | | | | | | remove the struct return argument of a csret function, even if it is obviously dead. llvm-svn: 28943
* De-pessimize the handling of LCSSA Phi nodes in IndVarSimplify. Hopefully thisOwen Anderson2006-06-271-15/+29
| | | | | | will make Shootout-C/nestedloop faster. llvm-svn: 28924
* random code cleanups, no functionality changeChris Lattner2006-06-261-9/+8
| | | | llvm-svn: 28914
* Make LoopUnswitch able to unswitch loops with live-out values by taking ↵Owen Anderson2006-06-261-53/+63
| | | | | | | | | advantage of LCSSA. This results several times the number of unswitchings occurring on tests such and timberwolfmc, unix-tbl, and ldecod. llvm-svn: 28912
* Fix IndVarsSimplify/2006-06-16-Indvar-LCSSA-Crash.ll, a case where aChris Lattner2006-06-171-4/+19
| | | | | | | | "LCSSA" phi node causes indvars to break dominance properties. This fixes causes indvars to avoid inserting aggressive code in this case, instead indvars should be fixed to be more aggressive in the face of lcssa phi's. llvm-svn: 28850
* Add missing casts. This fixed some regressions.Evan Cheng2006-06-161-2/+2
| | | | llvm-svn: 28834
* More libcall transformations:Evan Cheng2006-06-161-8/+110
| | | | | | | | printf("%s\n", str) -> puts(str) printf("%c", c) -> putchar(c) Also fixed fprintf(file, "%c", c) -> fputc(c, file) llvm-svn: 28815
* Simplify fprintf(file, "%s", str) to fputs(str, file).Evan Cheng2006-06-161-16/+36
| | | | llvm-svn: 28814
* Implement Transforms/InstCombine/bswap.ll, turning common shift/and/or bswapChris Lattner2006-06-151-1/+131
| | | | | | idioms into bswap intrinsics. llvm-svn: 28803
* Fix Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll, a loop unswitchChris Lattner2006-06-141-1/+13
| | | | | | bug exposed by the recent lcssa work. llvm-svn: 28779
* 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
* Reapply my 6/9 changes. The bug Evan saw no longer occurs.Owen Anderson2006-06-121-1/+7
| | | | llvm-svn: 28759
* 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-112-7/+1
| | | | | | MultiSource/Benchmarks/Prolangs-C/bison (and perhaps others). llvm-svn: 28747
* Add LCSSA as a requirement for LoopUnswitch, and assert that LoopUnswitch ↵Owen Anderson2006-06-091-0/+4
| | | | | | | | preserves LCSSA. llvm-svn: 28739
* 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
* RewriteExpr, either the new PHI node of induction variable or theEvan Cheng2006-06-091-0/+3
| | | | | | | | post-increment value, should be first cast to the appropriated type (to the type of the common expr). Otherwise, the rewrite of a use based on (common + iv) may end up with an incorrect type. llvm-svn: 28735
* Update some comments, and expose LCSSAID in preparation for having other passesOwen Anderson2006-06-081-1/+8
| | | | | | require LCSSA. llvm-svn: 28734
* Fix a spello in a comment.Reid Spencer2006-06-071-1/+1
| | | | llvm-svn: 28714
* Fix a bug in a recent patch. This fixes UnitTests/Vector/Altivec/casts.c onChris Lattner2006-06-061-1/+1
| | | | | | PPC/altivec llvm-svn: 28698
* 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
* Remove unneeded hook. Patch by Anton K. Thanks!Chris Lattner2006-06-021-2/+0
| | | | llvm-svn: 28664
* 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
* Silence a -pedantic warning.Chris Lattner2006-06-011-1/+1
| | | | llvm-svn: 28632
* 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
* Swap the order of operands created here. For +&|^, the order doesn't matter,Chris Lattner2006-05-311-2/+3
| | | | | | | but for sub, it really does! Fix fixes a miscompilation of fibheap_cut in llvmgcc4. llvm-svn: 28600
* 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