summaryrefslogtreecommitdiff
path: root/lib/Transforms
Commit message (Collapse)AuthorAge
...
* Fix PR582. The rewriter can move casts around, which invalidated theChris Lattner2005-06-15
| | | | | | | BB iterator. This fixes Transforms/IndVarsSimplify/2005-06-15-InstMoveCrash.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22221 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not promote globals only used by main to locals if there are constantexprsChris Lattner2005-06-15
| | | | | | | or other uses hanging off of them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22219 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR577 and testcase InstCombine/2005-06-15-ShiftSetCCCrash.ll.Chris Lattner2005-06-15
| | | | | | | Do not perform undefined out of range shifts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22217 91177308-0d34-0410-b5e6-96231b3b80d8
* Put the hack back in that removes features, causes regressions to fail, butReid Spencer2005-06-15
| | | | | | | allows test programs to succeed. Actual fix for this is forthcoming. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22213 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak several InstCombine regression checks introduced by a hack toReid Spencer2005-06-13
| | | | | | | fix the bzip2 test. A better hack is needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22209 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a 64-bit problem, passing (int)0 through ... instead of (void*)0Chris Lattner2005-06-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22206 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a problem on 64-bit targets where we passed (int)0 through ... instead ofChris Lattner2005-06-09
| | | | | | | (void*)0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22205 91177308-0d34-0410-b5e6-96231b3b80d8
* hack to fix bzip2 (bug 571)Andrew Lenharth2005-06-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22192 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the registration hash_map static. No other module needs it. Also,Reid Spencer2005-05-21
| | | | | | | document what its for a little better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22164 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust the file comment to read a little easier.Reid Spencer2005-05-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22163 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure ... arguments are casted to sbyte* where needed.Reid Spencer2005-05-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22162 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a "brief" comment for CastToCStrReid Spencer2005-05-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22161 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix mismatched type problem that crashed on cases like this:Chris Lattner2005-05-20
| | | | | | | | | sprintf(P, "%s", X); Where X is not an sbyte*. This fixes the bug JohnMC reported on llvm-bugs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22159 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Transforms/SimplifyCFG/switch-simplify-crash.llChris Lattner2005-05-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22158 91177308-0d34-0410-b5e6-96231b3b80d8
* teach the inliner about coldcc and noreturn functionsChris Lattner2005-05-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22113 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't look for __builtin_ffs, we'll never see it from llvm-gcc and there'sReid Spencer2005-05-15
| | | | | | | not reason to include it for other front ends. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22070 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide this optimization as well:Reid Spencer2005-05-15
| | | | | | | ffs(x) -> (x == 0 ? 0 : 1+llvm.cttz(x)) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22068 91177308-0d34-0410-b5e6-96231b3b80d8
* Duh .. you actually have to #include Config/config.h before you can testReid Spencer2005-05-15
| | | | | | | for one of the values that it defines! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22058 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes for ffs lib call simplification:Reid Spencer2005-05-14
| | | | | | | | | * Check for availability of ffsll call in configure script * Support ffs, ffsl, and ffsll conversion to constant value if the argument is constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22027 91177308-0d34-0410-b5e6-96231b3b80d8
* Preserve calling conv when hacking on callsChris Lattner2005-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22025 91177308-0d34-0410-b5e6-96231b3b80d8
* preserve calling conventions when hacking on codeChris Lattner2005-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22024 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure to preserve the calling convention when changing an invoke intoChris Lattner2005-05-14
| | | | | | | | a call. This fixes Prolangs-C++/deriv2, kimwitu++, and Misc-C++/bigfib on X86 with -enable-x86-fastcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22023 91177308-0d34-0410-b5e6-96231b3b80d8
* calling a function with the wrong CC is undefined, turn it into an unreachableChris Lattner2005-05-13
| | | | | | | | instruction. This is useful for catching optimizers that don't preserve calling conventions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21928 91177308-0d34-0410-b5e6-96231b3b80d8
* When lowering invokes to calls, amke sure to preserve the calling conv. ThisChris Lattner2005-05-13
| | | | | | | fixes Ptrdist/anagram with x86 llcbeta git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21925 91177308-0d34-0410-b5e6-96231b3b80d8
* Prefer int 0 instead of long 0 for GEP arguments.Chris Lattner2005-05-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21924 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Reassociate/shifttest.llChris Lattner2005-05-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21839 91177308-0d34-0410-b5e6-96231b3b80d8
* If a function contains no allocas, all of the calls in it are triviallyChris Lattner2005-05-09
| | | | | | | suitable for tail calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21836 91177308-0d34-0410-b5e6-96231b3b80d8
* implement and.ll:test33Chris Lattner2005-05-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21809 91177308-0d34-0410-b5e6-96231b3b80d8
* Preserve calling conventions when doing IPOChris Lattner2005-05-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21798 91177308-0d34-0410-b5e6-96231b3b80d8
* wrap long lines, preserve calling conventions when cloning functions andChris Lattner2005-05-09
| | | | | | | turning calls into invokes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21797 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert non-address taken functions with C calling conventions to fastcc.Chris Lattner2005-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21791 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Reassociate/mul-neg-add.llChris Lattner2005-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21788 91177308-0d34-0410-b5e6-96231b3b80d8
* Bail out earlierChris Lattner2005-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21786 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach reassociate that 0-X === X*-1Chris Lattner2005-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21785 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR557 and basictest[34].ll.Chris Lattner2005-05-08
| | | | | | | | | This makes reassociate realize that loads should be treated as unmovable, and gives distinct ranks to distinct values defined in the same basic block, allowing reassociate to do its thing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21783 91177308-0d34-0410-b5e6-96231b3b80d8
* Add debugging informationChris Lattner2005-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21781 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate gotosChris Lattner2005-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21780 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve reassociation handling of inverses, implementing inverses.ll.Chris Lattner2005-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21778 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up and modernize this pass.Chris Lattner2005-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21776 91177308-0d34-0410-b5e6-96231b3b80d8
* Strength reduce SAR into SHR if there is no way sign bits could be shiftedChris Lattner2005-05-08
| | | | | | | | | | | | in. This tends to get cases like this: X = cast ubyte to int Y = shr int X, ... Tested by: shift.ll:test24 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21775 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor some codeChris Lattner2005-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21772 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle some simple cases where we can see that values get annihilated.Chris Lattner2005-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21771 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a miscompilation of crafty by clobbering the "A" variable.Chris Lattner2005-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21770 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite the guts of the reassociate pass to be more efficient and logical. ↵Chris Lattner2005-05-07
| | | | | | | | | | Instead of trying to do local reassociation tweaks at each level, only process an expression tree once (at its root). This does not improve the reassociation pass in any real way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21768 91177308-0d34-0410-b5e6-96231b3b80d8
* * Add two strlen optimizations:Reid Spencer2005-05-07
| | | | | | | | | | | | | strlen(x) != 0 -> *x != 0 strlen(x) == 0 -> *x == 0 * Change nested statistics to use style of other LLVM statistics so that only the name of the optimization (simplify-libcalls) is used as the statistic name, and the description indicates which specific all is optimized. Cuts down on some redundancy and saves a few bytes of space. * Make note of stpcpy optimization that could be done. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21766 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't increment the counter unless the debug flag is set.Reid Spencer2005-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21762 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert shifts to muls to assist reassociation. This implementsChris Lattner2005-05-07
| | | | | | | Reassociate/shifttest.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21761 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the code and rearrange it. No major functionality changes here.Chris Lattner2005-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21759 91177308-0d34-0410-b5e6-96231b3b80d8
* BAD typeo which caused many testsuite failures last night. Note to self, doChris Lattner2005-05-06
| | | | | | | not change code after testing it without retesting! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21741 91177308-0d34-0410-b5e6-96231b3b80d8
* Preserve tail markerChris Lattner2005-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21737 91177308-0d34-0410-b5e6-96231b3b80d8