summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Skip the linear search if the answer is already known.Nick Lewycky2006-09-111-20/+22
| | | | llvm-svn: 30251
* Allow tail duplication in more cases, relaxing the previous restriction aChris Lattner2006-09-101-1/+12
| | | | | | bit. This fixes Regression/Transforms/TailDup/MergeTest.ll llvm-svn: 30237
* Replace EquivalenceClasses with a custom-built data structure. Many commonNick Lewycky2006-09-101-133/+259
| | | | | | | | | operations (like findProperties) should be faster, at the expense of unionSets being slower in cases that are rare in practise. Don't erase a dead Instruction. This fixes a memory corruption issue. llvm-svn: 30235
* Implement Transforms/InstCombine/hoist_instr.llChris Lattner2006-09-091-14/+54
| | | | llvm-svn: 30234
* Make inlining costs more accurate.Chris Lattner2006-09-091-3/+26
| | | | llvm-svn: 30231
* Turn div X, (Cond ? Y : 0) -> div X, YChris Lattner2006-09-091-19/+68
| | | | | | This implements select.ll::test18. llvm-svn: 30230
* Throttle back tail duplication to avoid creating really ugly sequences of code.Chris Lattner2006-09-071-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For Transforms/TailDup/if-tail-dup.ll, f.e., it produces: _foo: movl 8(%esp), %eax movl 4(%esp), %ecx testl $1, %ecx je LBB1_2 #cond_next LBB1_1: #cond_true movl $1, (%eax) LBB1_2: #cond_next testl $2, %ecx je LBB1_4 #cond_next10 LBB1_3: #cond_true6 movl $1, 4(%eax) LBB1_4: #cond_next10 testl $4, %ecx je LBB1_6 #cond_next18 LBB1_5: #cond_true14 movl $1, 8(%eax) LBB1_6: #cond_next18 testl $8, %ecx je LBB1_8 #return LBB1_7: #cond_true22 movl $1, 12(%eax) ret LBB1_8: #return ret instead of: _foo: movl 4(%esp), %eax testl $2, %eax sete %cl movl 8(%esp), %edx testl $1, %eax je LBB1_2 #cond_next LBB1_1: #cond_true movl $1, (%edx) testb %cl, %cl jne LBB1_4 #cond_next10 jmp LBB1_3 #cond_true6 LBB1_2: #cond_next testb %cl, %cl jne LBB1_4 #cond_next10 LBB1_3: #cond_true6 movl $1, 4(%edx) testl $4, %eax je LBB1_6 #cond_next18 jmp LBB1_5 #cond_true14 LBB1_4: #cond_next10 testl $4, %eax je LBB1_6 #cond_next18 LBB1_5: #cond_true14 movl $1, 8(%edx) testl $8, %eax je LBB1_8 #return jmp LBB1_7 #cond_true22 LBB1_6: #cond_next18 testl $8, %eax je LBB1_8 #return LBB1_7: #cond_true22 movl $1, 12(%edx) ret LBB1_8: #return ret llvm-svn: 30158
* 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
* Make ArgumentPromotion handle recursive functions that pass pointers in ↵Owen Anderson2006-09-021-11/+33
| | | | | | their recursive calls. llvm-svn: 30057
* Improve handling of SelectInst.Nick Lewycky2006-09-021-31/+44
| | | | | | | | Reorder operations to remove duplicated work. Fix to leave floating-point types out of the optimization. Add tests to predsimplify.ll for SwitchInst and SelectInst handling. llvm-svn: 30055
* Don't confuse canonicalize and lookup. Fixes predsimplify.reg4.ll. AlsoNick Lewycky2006-09-011-21/+20
| | | | | | corrects missing optimization opportunity removing cases from a switch. llvm-svn: 30009
* Properties where both Values weren't in the union (as being equal toNick Lewycky2006-08-311-24/+18
| | | | | | | | another Value) weren't being found by findProperties. This fixes predsimplify.ll test6, a missed optimization opportunity. llvm-svn: 29991
* Move to using the EquivalenceClass ADT. Removes SynSets.Nick Lewycky2006-08-301-165/+92
| | | | | | | | | If a branch's condition has become a ConstantBool, simplify it immediately. Removing the edge saves work and exposes up more optimization opportunities in the pass. Add support for SelectInst. llvm-svn: 29970
* Do not rely on std::sort and std::erase to get list of uniqueDevang Patel2006-08-291-10/+4
| | | | | | | | exit blocks. The output is dependent on addresses of basic block. Add and use Loop::getUniqueExitBlocks. llvm-svn: 29966
* Clean up a bit.Owen Anderson2006-08-291-51/+32
| | | | llvm-svn: 29950
* Add PredicateSimplifier pass. Collapses equal variables into one formNick Lewycky2006-08-281-0/+744
| | | | | | | and simplifies expressions. This implements the optimization described in PR807. llvm-svn: 29947
* Make LoopUnroll fold excessive BasicBlocks. This results in a significant ↵Owen Anderson2006-08-281-9/+89
| | | | | | | | speedup of gccas on 252.eon llvm-svn: 29936
* simplify AnalysisGroup registration, eliminating one typeid call.Chris Lattner2006-08-282-3/+3
| | | | llvm-svn: 29932
* eliminate RegisterOpt. It does the same thing as RegisterPass.Chris Lattner2006-08-2757-79/+84
| | | | llvm-svn: 29925
* s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|Chris Lattner2006-08-2711-11/+11
| | | | llvm-svn: 29911
* Fix a crash related to updating Phi nodes in the original header block. ↵Owen Anderson2006-08-251-1/+2
| | | | | | | | This was causing a crash in 175.vpr llvm-svn: 29887
* Add an assertion to check that we're really preserving LCSSA.Owen Anderson2006-08-251-0/+2
| | | | llvm-svn: 29886
* Reapply the indvars patch, since nothing blew up last night.Owen Anderson2006-08-251-0/+1
| | | | llvm-svn: 29874
* Revert my previous patch. Since there are some major changes that went in ↵Owen Anderson2006-08-251-3/+0
| | | | | | | | | today, I'm going to wait to put this in HEAD until tomorrow, so as not to clutter the nightly tester. llvm-svn: 29868
* Specify that indvars actually preserve LCSSA. This has been done for a ↵Owen Anderson2006-08-251-0/+3
| | | | | | | | while, but I forgot to put in the analysis usage. llvm-svn: 29867
* Implement unrolling of multiblock loops. This significantly improves theOwen Anderson2006-08-241-127/+125
| | | | | | | | utility of the LoopUnroll pass. Also, add a testcase for multiblock-loop unrolling. llvm-svn: 29859
* Fix a grammaro in a comment.Reid Spencer2006-08-181-1/+1
| | | | llvm-svn: 29765
* 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
OpenPOWER on IntegriCloud