summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/TailDuplication.cpp
Commit message (Collapse)AuthorAgeFilesLines
* replace a slow and verbose version of Instruction::isUsedOutsideOfBlock withChris Lattner2008-04-201-34/+4
| | | | | | a call to Instruction::isUsedOutsideOfBlock. llvm-svn: 50005
* Revert r49614. As Dan pointed out, some of these aren't correct.Owen Anderson2008-04-141-1/+1
| | | | llvm-svn: 49657
* Replace calls of the form V1->setName(V2->getName()) with V1->takeName(V2), Owen Anderson2008-04-131-1/+1
| | | | | | which is significantly more efficient. llvm-svn: 49614
* Don't include <map> in Pass.h, which doesn't need it. This requiresDan Gohman2008-03-211-0/+1
| | | | | | adding <map> to many files that actually do need it. llvm-svn: 48667
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Disable tail duplication of call instructions. The costChris Lattner2007-11-041-0/+5
| | | | | | | | metric is way off for these in general, and this works around buggy code like that in PR1764. we'll see if there is a big performance impact of this. If so, I'll revert it tomorrow. llvm-svn: 43668
* Fix typo in comment.Nick Lewycky2007-05-061-1/+1
| | | | llvm-svn: 36873
* Drop 'const'Devang Patel2007-05-031-2/+2
| | | | llvm-svn: 36662
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-2/+2
| | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. llvm-svn: 36652
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-0/+5
| | | | llvm-svn: 36632
* Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes inReid Spencer2007-02-051-1/+2
| | | | | | | the Transforms library. This reduces debug library size by 132 KB, debug binary size by 376 KB, and reduces link time for llvm tools slightly. llvm-svn: 33939
* Switch over Transforms/Scalar to use the STATISTIC macro. For each statisticChris Lattner2006-12-191-4/+2
| | | | | | | converted, we lose a static initializer. This also allows GCC to emit warnings about unused statistics. llvm-svn: 32690
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-061-2/+2
| | | | | | is 'unsigned'. llvm-svn: 32279
* Removed #include <iostream> and replaced with llvm_* streams.Bill Wendling2006-11-261-6/+4
| | | | llvm-svn: 31923
* set DEBUG_TYPE rightChris Lattner2006-09-271-0/+1
| | | | llvm-svn: 30623
* 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
* 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
* eliminate RegisterOpt. It does the same thing as RegisterPass.Chris Lattner2006-08-271-1/+1
| | | | llvm-svn: 29925
* Make iostream #inclusion explicitChris Lattner2006-01-221-0/+1
| | | | llvm-svn: 25514
* Remove trailing whitespaceMisha Brukman2005-04-211-6/+6
| | | | llvm-svn: 21427
* Do not count debugger intrinsics in size estimation.Chris Lattner2004-11-221-2/+6
| | | | llvm-svn: 18110
* Speed up the tail duplication pass on the testcase below from 68.2s to 1.23s:Chris Lattner2004-11-011-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | #define CL0(a) case a: f(); goto c; #define CL1(a) CL0(a##0) CL0(a##1) CL0(a##2) CL0(a##3) CL0(a##4) CL0(a##5) \ CL0(a##6) CL0(a##7) CL0(a##8) CL0(a##9) #define CL2(a) CL1(a##0) CL1(a##1) CL1(a##2) CL1(a##3) CL1(a##4) CL1(a##5) \ CL1(a##6) CL1(a##7) CL1(a##8) CL1(a##9) #define CL3(a) CL2(a##0) CL2(a##1) CL2(a##2) CL2(a##3) CL2(a##4) CL2(a##5) \ CL2(a##6) CL2(a##7) CL2(a##8) CL2(a##9) #define CL4(a) CL3(a##0) CL3(a##1) CL3(a##2) CL3(a##3) CL3(a##4) CL3(a##5) \ CL3(a##6) CL3(a##7) CL3(a##8) CL3(a##9) void f(); void a() { int b; c: switch (b) { CL4(1) } } This comes from GCC PR 15524 llvm-svn: 17390
* Reduce code growth implied by the tail duplication pass by not duplicatingChris Lattner2004-10-061-0/+75
| | | | | | | an instruction if it can be hoisted to a common dominator of the block. This implements: test/Regression/Transforms/TailDup/MergeTest.ll llvm-svn: 16758
* Prototype these functions more accuratelyChris Lattner2004-09-201-1/+1
| | | | llvm-svn: 16432
* Convert code to compile with vc7.1.Reid Spencer2004-09-151-2/+2
| | | | | | Patch contributed by Paolo Invernizzi. Thanks Paolo! llvm-svn: 16368
* Changes For Bug 352Reid Spencer2004-09-011-3/+3
| | | | | | | | Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. llvm-svn: 16137
* Fix #includes of i*.h => Instructions.h as per PR403.Misha Brukman2004-07-291-2/+1
| | | | llvm-svn: 15328
* Remove unused header file.Reid Spencer2004-05-251-1/+0
| | | | llvm-svn: 13750
* Make the tail duplication threshold accessible from the command line instead ↵Chris Lattner2004-04-181-1/+5
| | | | | | of hardcoded llvm-svn: 13025
* Fix bug in previous checkinChris Lattner2004-03-161-2/+7
| | | | llvm-svn: 12458
* Okay, so there is no reasonable way for tail duplication to update SSA form,Chris Lattner2004-03-161-195/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as it is making effectively arbitrary modifications to the CFG and we don't have a domset/domfrontier implementations that can handle the dynamic updates. Instead of having a bunch of code that doesn't actually work in practice, just demote any potentially tricky values to the stack (causing the problem to go away entirely). Later invocations of mem2reg will rebuild SSA for us. This fixes all of the major performance regressions with tail duplication from LLVM 1.1. For example, this loop: --- int popcount(int x) { int result = 0; while (x != 0) { result = result + (x & 0x1); x = x >> 1; } return result; } --- Used to be compiled into: int %popcount(int %X) { entry: br label %loopentry loopentry: ; preds = %entry, %no_exit %x.0 = phi int [ %X, %entry ], [ %tmp.9, %no_exit ] ; <int> [#uses=3] %result.1.0 = phi int [ 0, %entry ], [ %tmp.6, %no_exit ] ; <int> [#uses=2] %tmp.1 = seteq int %x.0, 0 ; <bool> [#uses=1] br bool %tmp.1, label %loopexit, label %no_exit no_exit: ; preds = %loopentry %tmp.4 = and int %x.0, 1 ; <int> [#uses=1] %tmp.6 = add int %tmp.4, %result.1.0 ; <int> [#uses=1] %tmp.9 = shr int %x.0, ubyte 1 ; <int> [#uses=1] br label %loopentry loopexit: ; preds = %loopentry ret int %result.1.0 } And is now compiled into: int %popcount(int %X) { entry: br label %no_exit no_exit: ; preds = %entry, %no_exit %x.0.0 = phi int [ %X, %entry ], [ %tmp.9, %no_exit ] ; <int> [#uses=2] %result.1.0.0 = phi int [ 0, %entry ], [ %tmp.6, %no_exit ] ; <int> [#uses=1] %tmp.4 = and int %x.0.0, 1 ; <int> [#uses=1] %tmp.6 = add int %tmp.4, %result.1.0.0 ; <int> [#uses=2] %tmp.9 = shr int %x.0.0, ubyte 1 ; <int> [#uses=2] %tmp.1 = seteq int %tmp.9, 0 ; <bool> [#uses=1] br bool %tmp.1, label %loopexit, label %no_exit loopexit: ; preds = %no_exit ret int %tmp.6 } llvm-svn: 12457
* Do not copy gigantic switch instructionsChris Lattner2004-03-161-1/+11
| | | | llvm-svn: 12441
* Disable tail duplication in a case that breaks on Olden/tspChris Lattner2004-03-011-0/+4
| | | | llvm-svn: 12021
* Fix PR255: [tailduplication] Single basic block loops are very rareChris Lattner2004-02-291-1/+2
| | | | | | | Note that this is a band-aid put over a band-aid. This just undisables tail duplication in on very specific case that it seems to work in. llvm-svn: 11989
* Implement Transforms/InstCombine/cast.ll:test13, a case which occurs in aChris Lattner2004-02-221-1/+2
| | | | | | hot 164.gzip loop. llvm-svn: 11702
* Disable tail duplication in any "hard" cases, where it might break SSA form.Chris Lattner2004-02-011-1/+27
| | | | llvm-svn: 11052
* Finegrainify namespacificationChris Lattner2004-01-091-5/+2
| | | | llvm-svn: 10725
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-0/+5
| | | | llvm-svn: 9903
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-201-0/+7
| | | | | | Header files will be on the way. llvm-svn: 9298
* Fix bug: TailDuplicate/2003-08-31-UnreachableBlocks.llChris Lattner2003-08-311-2/+5
| | | | llvm-svn: 8276
* Fix bug: TailDup/2003-08-23-InvalidatedPointers.llChris Lattner2003-08-231-16/+15
| | | | llvm-svn: 8078
* DEBUG got moved to Support/Debug.hChris Lattner2003-08-011-0/+1
| | | | llvm-svn: 7492
* Fix bug: TailDup/2003-07-22-InfiniteLoop.llChris Lattner2003-07-231-0/+5
| | | | llvm-svn: 7243
* Fix bug: TailDup/2003-06-24-Simpleloop.llChris Lattner2003-06-241-1/+2
| | | | llvm-svn: 6881
* Add paranoia checkingChris Lattner2003-06-221-1/+1
| | | | llvm-svn: 6856
* Test changeChris Lattner2003-06-221-0/+1
| | | | llvm-svn: 6852
* Initial checkin of Tail duplication pass.Chris Lattner2003-06-221-0/+324
llvm-svn: 6846
OpenPOWER on IntegriCloud