summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
Commit message (Collapse)AuthorAgeFilesLines
* Make sure to preserve the calling convention when changing an invoke intoChris Lattner2005-05-141-0/+2
| | | | | | | a call. This fixes Prolangs-C++/deriv2, kimwitu++, and Misc-C++/bigfib on X86 with -enable-x86-fastcc. llvm-svn: 22023
* wrap long lines, preserve calling conventions when cloning functions andChris Lattner2005-05-092-6/+14
| | | | | | turning calls into invokes llvm-svn: 21797
* BAD typeo which caused many testsuite failures last night. Note to self, doChris Lattner2005-05-061-1/+1
| | | | | | not change code after testing it without retesting! llvm-svn: 21741
* Implement Transforms/Inline/inline-tail.llChris Lattner2005-05-061-1/+16
| | | | llvm-svn: 21736
* DCE intrinsic instructions without side effects.Chris Lattner2005-05-061-1/+20
| | | | llvm-svn: 21719
* Remove optimizations that don't require both operands to be constant. TheseReid Spencer2005-04-291-10/+0
| | | | | | are moved to simplify-libcalls pass. llvm-svn: 21614
* * Add constant folding for additional floating point library calls such asReid Spencer2005-04-281-26/+90
| | | | | | | | sinh, cosh, etc. * Make the name comparisons for the fp libcalls a little more efficient by switching on the first character of the name before doing comparisons. llvm-svn: 21611
* Eliminate tabs and trailing spacesJeff Cohen2005-04-231-10/+10
| | | | llvm-svn: 21480
* Remove trailing whitespaceMisha Brukman2005-04-2114-151/+151
| | | | llvm-svn: 21427
* Improve doxygen documentation, patch contributed by Evan Jones!Chris Lattner2005-04-211-17/+17
| | | | llvm-svn: 21393
* Teach simplifycfg that setcc is cheap and non-trapping, so that it canChris Lattner2005-04-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | convert this: %tmp.1 = seteq int %i, 0 ; <bool> [#uses=1] br bool %tmp.1, label %shortcirc_done, label %shortcirc_next shortcirc_next: ; preds = %entry %tmp.4 = seteq int %j, 0 ; <bool> [#uses=1] br label %shortcirc_done shortcirc_done: ; preds = %shortcirc_next, %entry %shortcirc_val = phi bool [ %tmp.4, %shortcirc_next ], [ true, %entry ] ; <bool> [#uses=1] to this: %tmp.1 = seteq int %i, 0 ; <bool> [#uses=1] %tmp.4 = seteq int %j, 0 ; <bool> [#uses=1] %shortcirc_val = select bool %tmp.1, bool true, bool %tmp.4 ; <bool> [#uses=1] ... which is later simplified by instcombine into an or. llvm-svn: 21388
* Get rid of this for_each loopChris Lattner2005-04-121-2/+2
| | | | llvm-svn: 21253
* Fix the missing symbols problem Bill was hitting. Patch contributed byChris Lattner2005-03-172-0/+2
| | | | | | Bill Wendling!! llvm-svn: 20649
* This mega patch converts us from using Function::a{iterator|begin|end} toChris Lattner2005-03-154-15/+15
| | | | | | | | using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*. This patch is contributed by Gabor Greif, thanks! llvm-svn: 20597
* second argument to Value::setName is now gone.Chris Lattner2005-03-051-3/+3
| | | | llvm-svn: 20463
* Fix spelling, patch contributed by Gabor Greif!Chris Lattner2005-02-271-1/+1
| | | | llvm-svn: 20343
* remove extraneous castChris Lattner2005-02-261-2/+1
| | | | llvm-svn: 20334
* Implement Transforms/SimplifyCFG/switch_thread.llChris Lattner2005-02-241-4/+190
| | | | | | | | This does a simple form of "jump threading", which eliminates CFG edges that are provably dead. This triggers 90 times in the external tests, and eliminating CFG edges is always always a good thing! :) llvm-svn: 20300
* switchinst ctor now takes a hint for the number of cases that it will have.Chris Lattner2005-01-292-3/+3
| | | | llvm-svn: 19898
* Implement SimplifyCFG/DeadSetCC.llChris Lattner2005-01-011-0/+8
| | | | | | | | SimplifyCFG is one of those passes that we use for final cleanup: it should not rely on other passes to clean up its garbage. This fixes the "why are trivially dead setcc's in the output of gccas" problem. llvm-svn: 19212
* The split bb is really the exit of the old functionChris Lattner2004-12-111-2/+2
| | | | llvm-svn: 18799
* Fix Regression/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll,Chris Lattner2004-12-101-14/+13
| | | | | | and the failure on make_dparser last night. llvm-svn: 18766
* Squelch warningChris Lattner2004-11-301-1/+1
| | | | llvm-svn: 18381
* Fix test/Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llxChris Lattner2004-11-301-0/+2
| | | | | | This only fails on darwin or on X86 under valgrind. llvm-svn: 18377
* Alkis noticed that this variable is dead. Thanks!Chris Lattner2004-11-301-2/+0
| | | | llvm-svn: 18369
* If we have something like this:Chris Lattner2004-11-301-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | if (x) { code ... } else { code ... } Turn it into: code if (x) { ... } else { ... } This reduces code size and in some common cases allows us to completely eliminate the conditional. This turns several if/then/else blocks in loops into straightline code in 179.art, turning the loops into single basic blocks (good for modsched even!). Maybe now brg will leave me alone ;-) llvm-svn: 18366
* Allow constructor parameter to override aggregating args; fix spacingMisha Brukman2004-11-201-2/+2
| | | | llvm-svn: 18028
* Fix: CodeExtractor/2004-11-12-InvokeExtract.llChris Lattner2004-11-131-2/+16
| | | | llvm-svn: 17699
* Fix a bug where the code extractor would get a bit confused handling invokeChris Lattner2004-11-121-1/+13
| | | | | | instructions, setting DefBlock to a block it did not have dom info for. llvm-svn: 17697
* Do not compute the predecessor list for a block unless we need it.Chris Lattner2004-11-011-27/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This speeds up simplifycfg on this program, from 44.87s to 0.29s (with a profiled build): #define CL0(a) case a: 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 testcase is contrived to expose N^2 behavior, but this patch should speedup simplifycfg on any programs that use large switch statements. This testcase comes from GCC PR17895. llvm-svn: 17389
* Change Library Names Not To Conflict With Others When InstalledReid Spencer2004-10-271-1/+1
| | | | llvm-svn: 17286
* Eliminate compilation warning on uninitialized variable.Reid Spencer2004-10-221-1/+1
| | | | llvm-svn: 17163
* We won't use automakeReid Spencer2004-10-222-723/+0
| | | | llvm-svn: 17155
* Initial automake generated Makefile templateReid Spencer2004-10-181-0/+692
| | | | llvm-svn: 17136
* Correction to allow compilation with Visual C++.Reid Spencer2004-10-181-2/+2
| | | | | | Patch contributed by Morten Ofstad. Thanks Morten! llvm-svn: 17123
* Simplify code by deleting instructions that preceed unreachable instructions.Chris Lattner2004-10-181-1/+101
| | | | | | | Simplify code by simplifying terminators that branch to blocks that start with an unreachable instruction. llvm-svn: 17116
* Fix a bug that occurs when the constant value is the result of an invoke. InChris Lattner2004-10-181-5/+6
| | | | | | | particular, invoke ret values are only live in the normal dest of the invoke not in the unwind dest. llvm-svn: 17108
* Fix Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.llChris Lattner2004-10-171-4/+8
| | | | | | | If a function had no return instruction in it, and the result of the inlined call instruction was used, we would crash. llvm-svn: 17104
* When inserting PHI nodes, don't insert any phi nodes that are obviouslyChris Lattner2004-10-171-10/+31
| | | | | | | | | unneccesary. This allows us to delete several hundred phi nodes of the form PHI(x,x,x,undef) from 253.perlbmk and probably other programs as well. This implements Mem2Reg/UndefValuesMerge.ll llvm-svn: 17098
* Enhance hasConstantValue to ignore undef values in phi nodes. This allows itChris Lattner2004-10-171-2/+3
| | | | | | to think that PHI[4, undef] == 4. llvm-svn: 17096
* Add support for unreachableChris Lattner2004-10-161-3/+23
| | | | llvm-svn: 17056
* Add support for UndefValueChris Lattner2004-10-161-1/+2
| | | | llvm-svn: 17046
* When promoting mem2reg, make uninitialized values become undef isntead of 0.Chris Lattner2004-10-161-9/+9
| | | | llvm-svn: 17045
* When converting phi nodes into select instructions, we shouldn't promote PHIChris Lattner2004-10-141-41/+93
| | | | | | | | nodes unless we KNOW that we are able to promote all of them. This fixes: test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll llvm-svn: 16973
* Update to reflect changes in Makefile rules.Reid Spencer2004-10-131-4/+3
| | | | llvm-svn: 16950
* Initial version of automake Makefile.am file.Reid Spencer2004-10-101-0/+32
| | | | llvm-svn: 16893
* Do not insert trivially dead select instructions, which allows us toChris Lattner2004-09-291-2/+11
| | | | | | potentially fold more in one pass. llvm-svn: 16583
* Remove a whole bunch of horrible hacky code that was used to promote allocasChris Lattner2004-09-191-145/+7
| | | | | | | | | whose addresses where used by trivial phi nodes and select instructions. This is now performed by the instcombine pass, which is more powerful, is much simpler, and is faster. This allows the deletion of a bunch of code, two FIXME's and two gotos. llvm-svn: 16406
* Make sure to remove the Select instruction as wellChris Lattner2004-09-181-0/+1
| | | | llvm-svn: 16389
* Convert code to compile with vc7.1.Reid Spencer2004-09-155-31/+41
| | | | | | Patch contributed by Paolo Invernizzi. Thanks Paolo! llvm-svn: 16368
OpenPOWER on IntegriCloud