summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Handle single-entry PHI nodes correctly. This fixes PR877 andChris Lattner2006-08-141-1/+11
| | | | | | Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll llvm-svn: 29673
* 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
* Make this example pass use some things from lib/Support (EscapeString,Reid Spencer2006-08-071-2/+15
| | | | | | | | | | SlowOperatingInfo, Statistics). Besides providing an example of how to use these facilities, it also serves to debug problems with runtime linking when dlopening a loadable module. These three support facilities exercise different combinations of Text/Weak Weak/Text and Text/Text linking between the executable and the module. llvm-svn: 29552
* For PR780:Reid Spencer2006-08-071-1/+1
| | | | | | | | | | | | | 1. Change the usage of LOADABLE_MODULE so that it implies all the things necessary to make a loadable module. This reduces the user's burdern to get a loadable module correctly built. 2. Document the usage of LOADABLE_MODULE in the MakefileGuide 3. Adjust the makefile for lib/Transforms/Hello to use the new specification for building loadable modules 4. Adjust the sample project to not attempt to build a shared library for its little library. This was just wasteful and not instructive at all. llvm-svn: 29551
* Fix PR867 (and maybe 868) and testcsae:Chris Lattner2006-08-031-6/+25
| | | | | | Transforms/SimplifyCFG/2006-08-03-Crash.ll llvm-svn: 29515
* Changes:Chris Lattner2006-08-031-17/+46
| | | | | | | | | | | | | | | 1. Update an obsolete comment. 2. Make the sorting by base an explicit (though still N^2) step, so that the code is more clear on what it is doing. 3. Partition uses so that uses inside the loop are handled before uses outside the loop. Note that none of these changes currently changes the code inserted by LSR, but they are a stepping stone to getting there. This code is the result of some crazy pair programming with Nate. :) llvm-svn: 29493
* 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/+0
| | | | llvm-svn: 29324
* Minor comment tweaksChris Lattner2006-07-201-6/+5
| | | | llvm-svn: 29226
* Make it fit into 80 cols.Devang Patel2006-07-201-2/+2
| | | | llvm-svn: 29223
* Add new constructor to accept vector of exported names while creatingDevang Patel2006-07-201-0/+12
| | | | | | InternalizePass. llvm-svn: 29222
* Add an assertion.Owen Anderson2006-07-191-0/+2
| | | | llvm-svn: 29199
* Make LoopUnroll not die on LCSSA Phis. This makes lencod work again.Owen Anderson2006-07-191-0/+6
| | | | llvm-svn: 29198
* Fix a error that hadn't yet cause any problems, but I'm sure it would haveOwen Anderson2006-07-191-1/+1
| | | | | | somewhere down the road. llvm-svn: 29197
* silence warnings in a release buildChris Lattner2006-07-181-1/+1
| | | | llvm-svn: 29189
* Only reuse a previous IV if it would not require a type conversion.Evan Cheng2006-07-181-14/+17
| | | | llvm-svn: 29186
* eliminate some ugly code, using ConstantExpr::getWithOperands instead.Chris Lattner2006-07-141-35/+4
| | | | llvm-svn: 29149
* Hopefully the final attempt at making IndVars preserve LCSSA.Owen Anderson2006-07-141-2/+30
| | | | | | This should fix PR 831. llvm-svn: 29141
* Revert this patch temporarily until PR831 is fixed.Chris Lattner2006-07-131-31/+15
| | | | llvm-svn: 29134
* Handle instructions in the map, but that map to a null pointer.Chris Lattner2006-07-121-1/+2
| | | | | | This unbreaks smg2000. llvm-svn: 29127
* IndVars now (correctly) preserves LCSSA form.Owen Anderson2006-07-121-15/+31
| | | | llvm-svn: 29126
* 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-122-39/+48
| | | | | | | | | | | 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
* Silence a warning produced in assertions-disabled modeChris Lattner2006-07-111-1/+1
| | | | llvm-svn: 29108
* Revert my indvars changes because they were breaking things. Unfortunately thisOwen Anderson2006-07-111-29/+15
| | | | | | didn't start showing up until after the recent instcombine fixes. llvm-svn: 29102
* Add a comment, and fix a typo that broke the build.Owen Anderson2006-07-101-1/+2
| | | | llvm-svn: 29094
* Don't indent the entire function.Owen Anderson2006-07-101-50/+49
| | | | llvm-svn: 29093
* Recognize 16-bit bswaps by relaxing overconstrained pattern.Chris Lattner2006-07-101-2/+5
| | | | | | This implements Transforms/InstCombine/bswap.ll:test[34]. llvm-svn: 29087
* Make instcombine not remove Phi nodes when LCSSA is live.Owen Anderson2006-07-101-47/+51
| | | | llvm-svn: 29083
* 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
* Fix PR820 and Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.llChris Lattner2006-07-071-0/+3
| | | | llvm-svn: 29071
* 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
OpenPOWER on IntegriCloud