summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* These files don't need to include <iostream> since they include ↵Brian Gaeke2004-07-217-8/+0
| | | | | | "Support/Debug.h". llvm-svn: 15089
* * Further cleanup.Chris Lattner2004-07-211-9/+27
| | | | | | | | | | | * Test for whether bits are shifted out during the optzn. If so, the fold is illegal, though it can be handled explicitly for setne/seteq This fixes the miscompilation of 254.gap last night, which was a latent bug exposed by other optimizer improvements. llvm-svn: 15085
* Make cast-cast code a bit more defensiveChris Lattner2004-07-211-32/+42
| | | | | | "simplify" a bit of code for comparison/and folding llvm-svn: 15082
* Remove special casing of pointers and treat them generically as integers ofChris Lattner2004-07-211-8/+5
| | | | | | the appopriate size. This gives us the ability to eliminate int -> ptr -> int llvm-svn: 15063
* Fix a serious code pessimization problem. If an inlined function has a singleChris Lattner2004-07-201-5/+6
| | | | | | | return, clone the 'ret' BB code into the block AFTER the inlined call, not the other way around. llvm-svn: 15030
* Implement Transforms/InstCombine/IntPtrCast.llChris Lattner2004-07-201-11/+16
| | | | llvm-svn: 15029
* Ignore instructions that are in trivially dead functions. This allows usChris Lattner2004-07-201-4/+17
| | | | | | to constify 14 globals instead of 4 in a trivial C++ testcase. llvm-svn: 15027
* Implement InstCombine/GEPIdxCanon.llChris Lattner2004-07-201-1/+10
| | | | llvm-svn: 15024
* Implement SimplifyCFG/BrUnwind.llChris Lattner2004-07-201-2/+9
| | | | llvm-svn: 15022
* Rewrite cast->cast elimination code completely based on the information weChris Lattner2004-07-201-43/+53
| | | | | | | | actually care about. Someday when the cast instruction is gone, we can do better here, but this will do for now. This implements instcombine/cast.ll:test17/18 as well. llvm-svn: 15018
* Fix a performance regression from the CPR patch, simplify codeChris Lattner2004-07-181-14/+6
| | | | llvm-svn: 14974
* Strip out and simplify some code. This also fixes the regression lastChris Lattner2004-07-181-9/+2
| | | | | | | | | | night compiling cfrac. It did not realize that code like this: int G; int *H = &G; takes the address of G. llvm-svn: 14973
* Minor cleanup, no functionality changeChris Lattner2004-07-181-7/+2
| | | | llvm-svn: 14972
* Remove an if statement that would never be reached.Reid Spencer2004-07-181-3/+1
| | | | llvm-svn: 14968
* Delete a redundant if branch.Reid Spencer2004-07-181-4/+1
| | | | llvm-svn: 14967
* Expand the coercion of constants to include the newly constant Globals.Reid Spencer2004-07-181-2/+1
| | | | llvm-svn: 14966
* Delete a no-op loop.Reid Spencer2004-07-181-9/+0
| | | | llvm-svn: 14965
* Expand the scope to include global values because they are now constantsReid Spencer2004-07-181-1/+1
| | | | | | too. llvm-svn: 14964
* Avoid an unnecessary isa<Constant>.Reid Spencer2004-07-181-3/+1
| | | | llvm-svn: 14963
* Remove useless statistic, fix some slightly broken logicChris Lattner2004-07-181-8/+4
| | | | llvm-svn: 14958
* Fix a rather serious bug in previous checkinChris Lattner2004-07-181-1/+0
| | | | llvm-svn: 14957
* bug 122:Reid Spencer2004-07-1812-40/+30
| | | | | | - Replace ConstantPointerRef usage with GlobalValue usage llvm-svn: 14953
* bug 122:Reid Spencer2004-07-181-16/+13
| | | | | | | | - Replace ConstantPointerRef usage with GlobalValue usage - Minimize redundant isa<GlobalValue> usage - Correct isa<Constant> for GlobalValue subclass llvm-svn: 14950
* bug 122:Reid Spencer2004-07-184-13/+6
| | | | | | - Minimize redundant isa<GlobalValue> usage llvm-svn: 14948
* bug 122:Reid Spencer2004-07-181-16/+11
| | | | | | | - Replace ConstantPointerRef usage with GlobalValue usage - Correct isa<Constant> for GlobalValue subclass llvm-svn: 14947
* bug 122:Reid Spencer2004-07-182-5/+6
| | | | | | | - Minimize redundant isa<GlobalValue> usage - Correct isa<Constant> for GlobalValue subclass llvm-svn: 14946
* bug 122:Reid Spencer2004-07-181-22/+17
| | | | | | | - Replace ConstantPointerRef usage with GlobalValue usage - Rename methods to get ride of ConstantPointerRef usage llvm-svn: 14945
* bug 122:Reid Spencer2004-07-181-30/+1
| | | | | | - Excise dead CPR procesing. llvm-svn: 14944
* bug 122:Reid Spencer2004-07-181-6/+0
| | | | | | | - Replace ConstantPointerRef usage with GlobalValue usage - Correct test ordering for GlobalValue subclass llvm-svn: 14943
* This patch was contributed by Daniel Berlin!Chris Lattner2004-07-151-14/+48
| | | | | | | Speed up SCCP substantially by processing overdefined values quickly. This patch speeds up SCCP by about 30-40% on large testcases. llvm-svn: 14861
* Fix PR404 try #2Chris Lattner2004-07-151-8/+8
| | | | | | | This version takes about 1s longer than the previous one (down to 2.35s), but on the positive side, it actually works :) llvm-svn: 14856
* Revert previous patch until I get a bug fixedChris Lattner2004-07-151-12/+12
| | | | llvm-svn: 14853
* Fix PR404: Loop simplify is really slow on 252.eonChris Lattner2004-07-151-12/+12
| | | | | | | | This eliminates an N*N*logN algorithm from the loop simplify pass, replacing it with a much simpler and faster alternative. In a debug build, this reduces gccas time on eon from 85s to 42s. llvm-svn: 14851
* Progress on PR341Chris Lattner2004-07-155-35/+36
| | | | llvm-svn: 14840
* Fixes working towards PR341Chris Lattner2004-07-156-22/+23
| | | | llvm-svn: 14839
* Now that we codegen the portable "sizeof" efficiently, we can use it forChris Lattner2004-07-151-18/+22
| | | | | | | malloc lowering. This means that lowerallocations doesn't need targetdata anymore. yaay. llvm-svn: 14835
* Factor some code to handle "load (constantexpr cast foo)" just likeChris Lattner2004-07-131-20/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "load (cast foo)". This allows us to compile C++ code like this: class Bclass { public: virtual int operator()() { return 666; } }; class Dclass: public Bclass { public: virtual int operator()() { return 667; } } ; int main(int argc, char** argv) { Dclass x; return x(); } Into this: int %main(int %argc, sbyte** %argv) { entry: call void %__main( ) ret int 667 } Instead of this: int %main(int %argc, sbyte** %argv) { entry: %x = alloca "struct.std::bad_typeid" ; <"struct.std::bad_typeid"*> [#uses=3] call void %__main( ) %tmp.1.i.i = getelementptr "struct.std::bad_typeid"* %x, uint 0, uint 0, uint 0 ; <int (...)***> [#uses=1] store int (...)** getelementptr ([3 x int (...)*]* %vtable for Bclass, int 0, long 2), int (...)*** %tmp.1.i.i %tmp.3.i = getelementptr "struct.std::bad_typeid"* %x, int 0, uint 0, uint 0 ; <int (...)***> [#uses=1] store int (...)** getelementptr ([3 x int (...)*]* %vtable for Dclass, int 0, long 2), int (...)*** %tmp.3.i %tmp.5 = load int ("struct.std::bad_typeid"*)** cast (int (...)** getelementptr ([3 x int (...)*]* %vtable for Dclass, int 0, long 2) to int ("struct.std::bad_typeid"*)**) ; <int ("struct.std::bad_typeid"*)*> [#uses=1] %tmp.6 = call int %tmp.5( "struct.std::bad_typeid"* %x ) ; <int> [#uses=1] ret int %tmp.6 ret int 0 } In order words, we now resolve the virtual function call. llvm-svn: 14783
* Check to make sure types are sized before calling getTypeSize on them.Chris Lattner2004-07-061-13/+15
| | | | llvm-svn: 14649
* It doesn't matter what the 2nd operand is; if the GEP has 2 operands andBrian Gaeke2004-07-061-2/+1
| | | | | | the first is a zero, we should leave it alone. llvm-svn: 14648
* Add helper function.Brian Gaeke2004-07-061-2/+14
| | | | | | | Don't touch GEPs for which DecomposeArrayRef is not going to do anything special (e.g., < 2 indices, or 2 indices and the last one is a constant.) llvm-svn: 14647
* Implement rem.ll:test3Chris Lattner2004-07-061-0/+18
| | | | llvm-svn: 14640
* Fix a minor bug where we would go into infinite loops on some constantsChris Lattner2004-07-061-1/+2
| | | | llvm-svn: 14638
* Implement InstCombine/sub.ll:test15: X % -Y === X % YChris Lattner2004-07-061-2/+9
| | | | | | | Also, remove X % -1 = 0, because it's not true for unsigneds, and the signed case is superceeded by this new handling. llvm-svn: 14637
* Add #include <iostream> since Value.h does not #include it any more.Reid Spencer2004-07-0412-0/+15
| | | | llvm-svn: 14622
* Implement add.ll:test22, a common case in MSIL filesChris Lattner2004-07-031-0/+18
| | | | llvm-svn: 14587
* Do not call getTypeSize on a type that has no sizeChris Lattner2004-07-021-1/+2
| | | | llvm-svn: 14584
* Get rid of a dead variable, and fix a typo in a comment.Brian Gaeke2004-07-021-4/+1
| | | | llvm-svn: 14560
* Make this pass use a more specific debug message than "Processing:".Brian Gaeke2004-07-012-2/+2
| | | | llvm-svn: 14541
* Restoring this file.Vikram S. Adve2004-06-291-0/+76
| | | | llvm-svn: 14478
* Remove unused fileChris Lattner2004-06-281-495/+0
| | | | llvm-svn: 14460
OpenPOWER on IntegriCloud