summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/TailDuplication.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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