aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Emit low/high immediate loads properly for Linux/PPC.Nick Lewycky2007-03-031-6/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34871 91177308-0d34-0410-b5e6-96231b3b80d8
* my recent change caused a failure in a bswap testcase, because it changedChris Lattner2007-03-031-48/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the order that instcombine processed instructions in the testcase. The end result is that instcombine finished with: define i16 @test1(i16 %a) { %tmp = zext i16 %a to i32 ; <i32> [#uses=2] %tmp21 = lshr i32 %tmp, 8 ; <i32> [#uses=1] %tmp5 = shl i32 %tmp, 8 ; <i32> [#uses=1] %tmp.upgrd.32 = or i32 %tmp21, %tmp5 ; <i32> [#uses=1] %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16 ; <i16> [#uses=1] ret i16 %tmp.upgrd.3 } which can't get matched as a bswap. This patch makes instcombine more sophisticated about removing truncating casts, allowing it to turn this into: define i16 @test2(i16 %a) { %tmp211 = lshr i16 %a, 8 %tmp52 = shl i16 %a, 8 %tmp.upgrd.323 = or i16 %tmp211, %tmp52 ret i16 %tmp.upgrd.323 } which then matches as bswap. This fixes bswap.ll and implements InstCombine/cast2.ll:test[12]. This also implements cast elimination of add/sub. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34870 91177308-0d34-0410-b5e6-96231b3b80d8
* new testcase: instcombine should remove all the casts.Chris Lattner2007-03-031-0/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34869 91177308-0d34-0410-b5e6-96231b3b80d8
* Translate bit operations to English.Nick Lewycky2007-03-031-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34868 91177308-0d34-0410-b5e6-96231b3b80d8
* instcombine doesn't do CSE, simplify unrelated detailChris Lattner2007-03-031-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34867 91177308-0d34-0410-b5e6-96231b3b80d8
* Watch out for cases like this:Evan Cheng2007-03-031-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | entry (0x8b056f0, LLVM BB @0x8b01b30, ID#0): Live Ins: %r0 %r1 %r2 %r3 %reg1032 = tMOVrr %r3<kill> %reg1033 = tMOVri8 1 %reg1034 = tMOVri8 0 tCMPi8 %reg1029<kill>, 0 tBcc mbb<entry,0x8b06a10>, 0 Successors according to CFG: 0x8b06980 0x8b06a10 entry (0x8b06980, LLVM BB @0x8b01b30, ID#12): Predecessors according to CFG: 0x8b056f0 %reg1036 = tMOVrr %reg1034<kill> Successors according to CFG: 0x8b06a10 entry (0x8b06a10, LLVM BB @0x8b01b30, ID#13): Predecessors according to CFG: 0x8b056f0 0x8b06980 %reg1024<dead> = tMOVrr %reg1030<kill> ... reg1030 and r1 have already been joined. When reg1024 and reg1030 are joined, r1 live range from function entry to the tMOVrr instruction are dead. Eliminate r1 from the livein set of the entry BB, not the BB where the copy is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34866 91177308-0d34-0410-b5e6-96231b3b80d8
* add a top-level iteration loop to instcombine. This means that it will neverChris Lattner2007-03-031-4/+21
| | | | | | | finish without combining something it is capable of. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34865 91177308-0d34-0410-b5e6-96231b3b80d8
* APIntify this pass.Reid Spencer2007-03-031-28/+36
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34863 91177308-0d34-0410-b5e6-96231b3b80d8
* Add isPositive for symmetry with isNegative.Reid Spencer2007-03-031-1/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34862 91177308-0d34-0410-b5e6-96231b3b80d8
* Finally get this patch right :)Reid Spencer2007-03-021-5/+5
| | | | | | | Replace expensive getZExtValue() == 0 calls with isZero() calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34861 91177308-0d34-0410-b5e6-96231b3b80d8
* Dang, I've done that twice now! Undo previous commit.Reid Spencer2007-03-021-12/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34860 91177308-0d34-0410-b5e6-96231b3b80d8
* Use more efficient test for one value in a ConstantInt.Reid Spencer2007-03-022-13/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34859 91177308-0d34-0410-b5e6-96231b3b80d8
* Guard against huge loop trip counts in an APInt safe way.Reid Spencer2007-03-021-2/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34858 91177308-0d34-0410-b5e6-96231b3b80d8
* X86-64 VACOPY needs custom expansion. va_list is a struct { i32, i32, i8*, ↵Evan Cheng2007-03-022-3/+34
| | | | | | i8* }. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34857 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure debug code is not evaluated in non-debug case.Reid Spencer2007-03-021-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34856 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Sort switch cases using APInt safe comparison.Reid Spencer2007-03-021-2/+2
| | | | | | | 2. Make sure debug output of APInt values is safe for all bit widths. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34855 91177308-0d34-0410-b5e6-96231b3b80d8
* Use APInt safe isOne() method on ConstantInt instead of getZExtValue()==1Reid Spencer2007-03-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34854 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sorting of ConstantInt be APInt clean through use of ult function.Reid Spencer2007-03-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34853 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ashr for bitwidths > 64. This is now validated up to 1024 bits.Reid Spencer2007-03-021-33/+49
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34852 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix uninitialized use of variable. Remove tabs and fix identation.Anton Korobeynikov2007-03-021-19/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34850 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify thingsAnton Korobeynikov2007-03-021-8/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34849 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a significant algorithm problem with the instcombine worklist. removingChris Lattner2007-03-021-54/+70
| | | | | | | | | | | a value from the worklist required scanning the entire worklist to remove all entries. We now use a combination map+vector to prevent duplicates from happening and prevent the scan. This speeds up instcombine on a large file from the llvm-gcc bootstrap from 189.7s to 4.84s in a debug build and from 5.04s to 1.37s in a release build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34848 91177308-0d34-0410-b5e6-96231b3b80d8
* minor cleanupChris Lattner2007-03-021-6/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34846 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1234 by working around a compiler bug.Chris Lattner2007-03-021-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34845 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark dead def as unused.Evan Cheng2007-03-021-2/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34844 91177308-0d34-0410-b5e6-96231b3b80d8
* Dead live-in detection bug.Evan Cheng2007-03-021-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34843 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new test case.Evan Cheng2007-03-021-0/+85
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34842 91177308-0d34-0410-b5e6-96231b3b80d8
* - Keep track all def and uses of stack slot available in register.Evan Cheng2007-03-021-28/+51
| | | | | | | - Available value use may be deleted (e.g. noop move). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34841 91177308-0d34-0410-b5e6-96231b3b80d8
* testcase for PR1233Chris Lattner2007-03-021-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34840 91177308-0d34-0410-b5e6-96231b3b80d8
* Invalidate last use of a reused register if the use is a deleted noop copy.Evan Cheng2007-03-021-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34839 91177308-0d34-0410-b5e6-96231b3b80d8
* argument lowering should copy from the vreg shadows of live-in argumentsChris Lattner2007-03-021-7/+7
| | | | | | | passed in registers, not directly from the pregs themselves. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34838 91177308-0d34-0410-b5e6-96231b3b80d8
* add a noteChris Lattner2007-03-021-0/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34837 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo.Owen Anderson2007-03-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34836 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a better algorithm for rounding sqrt results. Change the FIXME aboutReid Spencer2007-03-021-8/+12
| | | | | | | | | | this to a NOTE: because pari/gp results start to get rounded incorrectly after 192 bits of precision. APInt and pari/gp never differ by more than 1, but APInt is more accurate because it does not lose precision after 192 bits as does pari/gp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34834 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement unionWith.Nick Lewycky2007-03-021-2/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34833 91177308-0d34-0410-b5e6-96231b3b80d8
* switch the inliner from being recursive to being iterative.Chris Lattner2007-03-021-6/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34832 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an unequal bitwidth issue.Reid Spencer2007-03-021-3/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34831 91177308-0d34-0410-b5e6-96231b3b80d8
* grammaroChris Lattner2007-03-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34830 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it 64-bit safe.Evan Cheng2007-03-021-7/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34829 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a FIXMEReid Spencer2007-03-021-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34828 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo.Reid Spencer2007-03-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34826 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a problem where shifting by 64-bits leads to incorrect results on PPCReid Spencer2007-03-021-1/+4
| | | | | | | but not on X86 becuase shift by word size is "undefined". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34825 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate unnecessary reset of SP in epilog on darwinDale Johannesen2007-03-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34824 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverse a premature commital.Reid Spencer2007-03-021-21/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34822 91177308-0d34-0410-b5e6-96231b3b80d8
* Prefer non-virtual calls to ConstantInt::isZero over virtual calls toReid Spencer2007-03-029-42/+46
| | | | | | | Constant::isNullValue() in situations where it is possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34821 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a non-virtual test for zero, isZero, and rename isUnitValue isOne.Reid Spencer2007-03-021-2/+10
| | | | | | | | These will be used in upcoming patches to avoid virtual function call when the client knows it is a ConstantInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34820 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an abs() function to get the absolute value.Reid Spencer2007-03-011-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34819 91177308-0d34-0410-b5e6-96231b3b80d8
* Combine two lines that can be.Reid Spencer2007-03-011-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34818 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove virtual keyword from method that doesn't need to be virtual.Reid Spencer2007-03-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34817 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to create an SCEVUnknown from an APInt as well as an int.Reid Spencer2007-03-012-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34816 91177308-0d34-0410-b5e6-96231b3b80d8