summaryrefslogtreecommitdiff
path: root/lib/Transforms
Commit message (Collapse)AuthorAge
...
* Constant exprs are not efficiently negatable in practice. This disablesChris Lattner2004-12-14
| | | | | | | turning X - (constantexpr) into X + (-constantexpr) among other things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18935 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix link error in PPC optimized build of 'opt'.Brian Gaeke2004-12-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18913 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of getSizeOf, using ConstantExpr::getSizeOf instead.Chris Lattner2004-12-13
| | | | | | | | | | | | do not insert a prototype for malloc of: void* malloc(uint): on 64-bit u targets this is not correct. Instead of prototype it as void *malloc(...), and pass the correct intptr_t through the "...". Finally, fix Regression/CodeGen/SparcV9/2004-12-13-MallocCrash.ll, by not forming constantexpr casts from pointer to uint. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18908 91177308-0d34-0410-b5e6-96231b3b80d8
* Change indentation of a whole bunch of code, no real changes here.Chris Lattner2004-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18843 91177308-0d34-0410-b5e6-96231b3b80d8
* More substantial simplifications and speedups. This makes ADCE about 20% fasterChris Lattner2004-12-12
| | | | | | | in some cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18842 91177308-0d34-0410-b5e6-96231b3b80d8
* More minor microoptimizationsChris Lattner2004-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18841 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some more set operationsChris Lattner2004-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18840 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce number of set operations.Chris Lattner2004-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18839 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize div/rem + select combinations more.Chris Lattner2004-12-12
| | | | | | | In particular, implement div.ll:test10 and rem.ll:test4. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18838 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly implement copying of a global, fixing the 255.vortex & povrayChris Lattner2004-12-12
| | | | | | | failures from last night. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18832 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code and do not invalidate iterators.Chris Lattner2004-12-12
| | | | | | | | This fixes a crash compiling TimberWolfMC that was exposed due to recent optimizer changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18831 91177308-0d34-0410-b5e6-96231b3b80d8
* Though the previous xform applies to literally dozens (hundreds?) of variablesChris Lattner2004-12-12
| | | | | | | | | | | | | | | | | | | | | in SPEC, the subsequent optimziations that we are after don't play with with FP values, so disable this xform for them. Really we just don't want stuff like: double G; (always 0 or 412312.312) = G; turning into: bool G_b; = G_b ? 412312.312 : 0; We'd rather just do the load. -Chris git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18819 91177308-0d34-0410-b5e6-96231b3b80d8
* If a variable can only hold two values, and is not already a bool, shrink itChris Lattner2004-12-12
| | | | | | | | | | | down to actually BE a bool. This allows simple value range propagation stuff work harder, deleting comparisons in bzip2 in some hot loops. This implements GlobalOpt/integer-bool.ll, which is the essence of the loop condition distilled into a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18817 91177308-0d34-0410-b5e6-96231b3b80d8
* If one side of and/or is known to be 0/-1, it doesn't matterChris Lattner2004-12-11
| | | | | | | | | if the other side is overdefined. This allows us to fold conditions like: if (X < Y || Y > Z) in some cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18807 91177308-0d34-0410-b5e6-96231b3b80d8
* Only cound if we actually made a change.Chris Lattner2004-12-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18800 91177308-0d34-0410-b5e6-96231b3b80d8
* The split bb is really the exit of the old functionChris Lattner2004-12-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18799 91177308-0d34-0410-b5e6-96231b3b80d8
* Two bug fixes:Chris Lattner2004-12-11
| | | | | | | | | | | | | | | | | | 1. Actually increment the Statistic for the GV elim optzn 2. When resolving undef branches, only resolve branches in executable blocks, avoiding marking a bunch of completely dead blocks live. This has a big impact on the quality of the generated code. With this patch, we positively rip up vortex, compiling Ut_MoveBytes to a single memcpy call. In vortex we get this: 12 ipsccp - Number of globals found to be constant 986 ipsccp - Number of arguments constant propagated 1378 ipsccp - Number of basic blocks unreachable 8919 ipsccp - Number of instructions removed git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18796 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not delete the entry block to a function.Chris Lattner2004-12-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18795 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Transforms/SCCP/ipsccp-gvar.ll, by tracking values stored toChris Lattner2004-12-11
| | | | | | | non-address-taken global variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18790 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug where we could delete dead invoke instructions with uses.Chris Lattner2004-12-11
| | | | | | | | In functions where we fully constant prop the return value, replace all ret instructions with 'ret undef'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18786 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement SCCP/ipsccp-conditional.ll, by totally deleting dead blocks.Chris Lattner2004-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18781 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SCCP/2004-12-10-UndefBranchBug.llChris Lattner2004-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18776 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Regression/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll,Chris Lattner2004-12-10
| | | | | | | and the failure on make_dparser last night. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18766 91177308-0d34-0410-b5e6-96231b3b80d8
* This is the initial implementation of IPSCCP, as requested by Brian.Chris Lattner2004-12-10
| | | | | | | | | | This implements SCCP/ipsccp-basic.ll, rips apart Olden/mst (as described in PR415), and does other nice things. There is still more to come with this, but it's a start. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18752 91177308-0d34-0410-b5e6-96231b3b80d8
* note to self: Do not check in debugging code!Chris Lattner2004-12-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18693 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement trivial sinking for load instructions. This causes us to sink 567 ↵Chris Lattner2004-12-09
| | | | | | loads in spec git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18692 91177308-0d34-0410-b5e6-96231b3b80d8
* Do extremely simple sinking of instructions when they are only used in aChris Lattner2004-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | successor block. This turns cases like this: x = a op b if (c) { use x } into: if (c) { x = a op b use x } This triggers 3965 times in spec, and is tested by Regression/Transforms/InstCombine/sink_instruction.ll This appears to expose a bug in the X86 backend for 177.mesa, which I'm looking in to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18677 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix this regression and remove the XFAIL from this test.Alkis Evlogimenos2004-12-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18674 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Transforms/InstCombine/2004-12-08-RemInfiniteLoop.llChris Lattner2004-12-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18670 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for compilers without argument dependent name lookup, contributedChris Lattner2004-12-08
| | | | | | | by Bjørn Wennberg git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18627 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded class qualifier, contributed by Bjørn WennbergChris Lattner2004-12-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18625 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR387:\Reid Spencer2004-12-07
| | | | | | | Add doInitialization method to avoid overloaded virtuals git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18602 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement stripping of debug symbols, making the --strip-debug options inChris Lattner2004-12-03
| | | | | | | gccas/gccld more than just a noop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18456 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial reimplementation of the -strip pass, with a stub for implementingChris Lattner2004-12-02
| | | | | | | -S git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18440 91177308-0d34-0410-b5e6-96231b3b80d8
* This pass is moving to lib IPOChris Lattner2004-12-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18439 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a FIXME by checking to make sure that a malloc is not being usedChris Lattner2004-12-02
| | | | | | | | | | in scary and unknown ways before we promote it. This fixes the miscompilation of 188.ammp that has been plauging us since a globalopt patch went in. Thanks a ton to Tanya for helping me diagnose the problem! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18418 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a minor bug where we set a var to initialized on malloc, not on store.Chris Lattner2004-12-02
| | | | | | | This doesn't fix anything that I'm aware of, just noticed it by inspection git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18417 91177308-0d34-0410-b5e6-96231b3b80d8
* This pass is completely broken.Chris Lattner2004-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18387 91177308-0d34-0410-b5e6-96231b3b80d8
* Squelch warningChris Lattner2004-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18381 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test/Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llxChris Lattner2004-11-30
| | | | | | | This only fails on darwin or on X86 under valgrind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18377 91177308-0d34-0410-b5e6-96231b3b80d8
* Alkis noticed that this variable is dead. Thanks!Chris Lattner2004-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18369 91177308-0d34-0410-b5e6-96231b3b80d8
* If we have something like this:Chris Lattner2004-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18366 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow hoisting loads of globals and alloca's in conditionals.Chris Lattner2004-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18363 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR454:Reid Spencer2004-11-28
| | | | | | | | * Make sure we handle signed to unsigned conversion correctly * Move this visitSetCondInst case to its own method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18312 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DSE potentially more aggressive by being more specific about alloca sizes.Chris Lattner2004-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18309 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Regression/Transforms/InstCombine/getelementptr_cast.ll, whichChris Lattner2004-11-27
| | | | | | | occurs many times in crafty git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18273 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide size information when checking to see if we can LICM a load, thisChris Lattner2004-11-26
| | | | | | | allows us to hoist more loads in some cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18265 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not count debugger intrinsics in size estimation.Chris Lattner2004-11-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18110 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore debugger intrinsics when doing inlining size computations.Chris Lattner2004-11-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18109 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not consider debug intrinsics in the size computations for loop unrolling.Chris Lattner2004-11-22
| | | | | | | Patch contributed by Michael McCracken! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18108 91177308-0d34-0410-b5e6-96231b3b80d8