aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/InstCombine
Commit message (Collapse)AuthorAgeFilesLines
* simplify this code.Chris Lattner2010-01-051-109/+66
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92800 91177308-0d34-0410-b5e6-96231b3b80d8
* make this a static function instead of a method.Chris Lattner2010-01-052-6/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92795 91177308-0d34-0410-b5e6-96231b3b80d8
* more rearrangement and cleanup, fix my test failure.Chris Lattner2010-01-051-118/+104
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92792 91177308-0d34-0410-b5e6-96231b3b80d8
* cleanupChris Lattner2010-01-051-18/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92790 91177308-0d34-0410-b5e6-96231b3b80d8
* remove two trunc xforms that are subsumed by EvaluateInDifferentType.Chris Lattner2010-01-051-36/+0
| | | | | | | | The only difference is that EvaluateInDifferentType checks to ensure they are profitable before doing them :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92788 91177308-0d34-0410-b5e6-96231b3b80d8
* just remove this xform which is subsumed by others.Chris Lattner2010-01-051-26/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92775 91177308-0d34-0410-b5e6-96231b3b80d8
* move a trunc-specific transform out of commonIntCastTransforms into visitTrunc.Chris Lattner2010-01-051-32/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92773 91177308-0d34-0410-b5e6-96231b3b80d8
* Move remaining stuff to the isInteger predicate.Benjamin Kramer2010-01-052-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92771 91177308-0d34-0410-b5e6-96231b3b80d8
* move a zext specific xform out of commonIntCastTransforms into visitZExt and ↵Chris Lattner2010-01-051-10/+9
| | | | | | modernize it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92770 91177308-0d34-0410-b5e6-96231b3b80d8
* move a trunc-specific xform out of commonIntCastTransforms into visitTruncChris Lattner2010-01-051-16/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92768 91177308-0d34-0410-b5e6-96231b3b80d8
* reduce indentationChris Lattner2010-01-051-15/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92766 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert a ton of simple integer type equality tests to the new predicate.Benjamin Kramer2010-01-055-9/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92760 91177308-0d34-0410-b5e6-96231b3b80d8
* optimize comparisons against cttz/ctlz/ctpop, patch by Alastair Lynn!Chris Lattner2010-01-051-1/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92745 91177308-0d34-0410-b5e6-96231b3b80d8
* Use do+while instead of while for loops which obviously have aDan Gohman2010-01-051-4/+3
| | | | | | | non-zero trip count. Use SmallVector's pop_back_val(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92734 91177308-0d34-0410-b5e6-96231b3b80d8
* Add newline at EOF.Benjamin Kramer2010-01-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92727 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-051-1/+1
| | | | | | dereference the type pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92726 91177308-0d34-0410-b5e6-96231b3b80d8
* prune some #includes.Chris Lattner2010-01-051-8/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92712 91177308-0d34-0410-b5e6-96231b3b80d8
* split and/or/xor out into one overly-large (2000LOC) file. However, I thinkChris Lattner2010-01-053-1963/+1978
| | | | | | | it does make sense to keep them together, at least for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92711 91177308-0d34-0410-b5e6-96231b3b80d8
* missed file with previous commit.Chris Lattner2010-01-051-418/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92710 91177308-0d34-0410-b5e6-96231b3b80d8
* split instcombine of shifts out to its own file.Chris Lattner2010-01-052-0/+437
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92709 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate getBitCastOperand and simplify some over-complex inbounds stuff.Chris Lattner2010-01-051-46/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92708 91177308-0d34-0410-b5e6-96231b3b80d8
* split call handling out to InstCombineCalls.cppChris Lattner2010-01-053-1110/+1133
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92707 91177308-0d34-0410-b5e6-96231b3b80d8
* optimize cttz and ctlz when we can prove something about the Chris Lattner2010-01-051-1/+34
| | | | | | | leading/trailing bits. Patch by Alastair Lynn! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92706 91177308-0d34-0410-b5e6-96231b3b80d8
* this inline function moved to addsubChris Lattner2010-01-051-24/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92705 91177308-0d34-0410-b5e6-96231b3b80d8
* split add/sub out to its own file. Eliminate use ofChris Lattner2010-01-053-695/+749
| | | | | | | | dyn_castNotVal in the X+~X transform. dyn_castNotVal is dramatic overkill for what the xform needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92704 91177308-0d34-0410-b5e6-96231b3b80d8
* all the places we use hasOneUse() we know are instructions, so inlineChris Lattner2010-01-051-12/+9
| | | | | | | and simplify. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92700 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate AssociativeOpt and its last uses.Chris Lattner2010-01-051-35/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92697 91177308-0d34-0410-b5e6-96231b3b80d8
* inline the FoldICmpLogical functor.Chris Lattner2010-01-051-98/+90
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92695 91177308-0d34-0410-b5e6-96231b3b80d8
* inline the 'AddRHS' transformation, simplifying things significantly.Chris Lattner2010-01-051-39/+4
| | | | | | | | | | Eliminate the 'AddMaskingAnd' transformation, it is redundant with this more general code right below it: // A+B --> A|B iff A and B have no bits set in common. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92693 91177308-0d34-0410-b5e6-96231b3b80d8
* remove massive over-genality manifested as a big template Chris Lattner2010-01-051-60/+1
| | | | | | | | | that got instantiated. There is no reason for instcombine to try this hard for simple associative optimizations. Next up, eliminate the template completely. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92692 91177308-0d34-0410-b5e6-96231b3b80d8
* split mul/div/rem instructions out to their own file.Chris Lattner2010-01-054-674/+701
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92689 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up header.Chris Lattner2010-01-051-7/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92688 91177308-0d34-0410-b5e6-96231b3b80d8
* split select out to its own file.Chris Lattner2010-01-053-692/+712
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92687 91177308-0d34-0410-b5e6-96231b3b80d8
* split out load/store/alloca.Chris Lattner2010-01-053-607/+614
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92685 91177308-0d34-0410-b5e6-96231b3b80d8
* reduce indentationChris Lattner2010-01-051-4/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92684 91177308-0d34-0410-b5e6-96231b3b80d8
* split vector stuff out to InstCombineVectorOps.cppChris Lattner2010-01-053-540/+558
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92683 91177308-0d34-0410-b5e6-96231b3b80d8
* split PHI node stuff out to InstCombinePHI.cppChris Lattner2010-01-053-821/+842
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92682 91177308-0d34-0410-b5e6-96231b3b80d8
* convert various IntrinsicInst's to use class instead of struct.Chris Lattner2010-01-051-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92681 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead debug info intrinsics.Devang Patel2010-01-051-1/+0
| | | | | | | | | | | | Intrinsic::dbg_stoppoint Intrinsic::dbg_region_start Intrinsic::dbg_region_end Intrinsic::dbg_func_start AutoUpgrade simply ignores these intrinsics now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92557 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some struct/class specifier mismatches.Daniel Dunbar2010-01-051-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92550 91177308-0d34-0410-b5e6-96231b3b80d8
* Truncate GEP indexes larger than the pointer size down to pointer sizeChris Lattner2010-01-041-0/+9
| | | | | | | | | | | | when doing this transform if the GEP is not inbounds. No testcase because it is very difficult to trigger this: instcombine already canonicalizes GEP indices to pointer size, so it relies specific permutations of the instcombine worklist. Thanks to Duncan for pointing this possible problem out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92495 91177308-0d34-0410-b5e6-96231b3b80d8
* silence a bogus 'might be used uninit' warning from GCC.Chris Lattner2010-01-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92494 91177308-0d34-0410-b5e6-96231b3b80d8
* move some more cast-related stuffChris Lattner2010-01-042-140/+125
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92471 91177308-0d34-0410-b5e6-96231b3b80d8
* move the [Can]EvaluateInDifferentType functions out to InstCombineCasts.cppChris Lattner2010-01-042-212/+209
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92469 91177308-0d34-0410-b5e6-96231b3b80d8
* split 943 lines of instcombine out to a new InstCombineCasts.cppChris Lattner2010-01-044-943/+981
| | | | | | | file. InstructionCombining.cpp is now down to a svelte 9300 lines :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92468 91177308-0d34-0410-b5e6-96231b3b80d8
* split instcombine of compares (visit[FI]Cmp) out toChris Lattner2010-01-044-2435/+2477
| | | | | | | a new InstCombineCompares.cpp file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92467 91177308-0d34-0410-b5e6-96231b3b80d8
* update cmakefileChris Lattner2010-01-041-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92466 91177308-0d34-0410-b5e6-96231b3b80d8
* move the 'SimplifyDemandedFoo' methods out to their own file, cutting 1K ↵Chris Lattner2010-01-043-1093/+1114
| | | | | | lines out of instcombine.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92465 91177308-0d34-0410-b5e6-96231b3b80d8
* split the instcombine class definition out to a header shared Chris Lattner2010-01-042-299/+329
| | | | | | | among the instcombine library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92463 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a ton of unneeded LLVMContext stuff.Chris Lattner2010-01-042-279/+289
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92462 91177308-0d34-0410-b5e6-96231b3b80d8