Chris Lattner
892090ea95
add a top-level iteration loop to instcombine. This means that it will never
...
finish without combining something it is capable of.
llvm-svn: 34865
2007-03-03 02:04:50 +00:00
Reid Spencer
8c49eb7da5
APIntify this pass.
...
llvm-svn: 34863
2007-03-03 00:48:31 +00:00
Reid Spencer
e5244b132b
Add isPositive for symmetry with isNegative.
...
llvm-svn: 34862
2007-03-03 00:24:39 +00:00
Reid Spencer
6f7b9afc1c
Finally get this patch right :)
...
Replace expensive getZExtValue() == 0 calls with isZero() calls.
llvm-svn: 34861
2007-03-02 23:51:25 +00:00
Reid Spencer
438d17b5ad
Dang, I've done that twice now! Undo previous commit.
...
llvm-svn: 34860
2007-03-02 23:37:53 +00:00
Reid Spencer
70fbfc75e8
Use more efficient test for one value in a ConstantInt.
...
llvm-svn: 34859
2007-03-02 23:35:28 +00:00
Reid Spencer
76f02c5848
Guard against huge loop trip counts in an APInt safe way.
...
llvm-svn: 34858
2007-03-02 23:31:34 +00:00
Evan Cheng
2fb461c1b5
X86-64 VACOPY needs custom expansion. va_list is a struct { i32, i32, i8*, i8* }.
...
llvm-svn: 34857
2007-03-02 23:16:35 +00:00
Reid Spencer
884f32fd12
Make sure debug code is not evaluated in non-debug case.
...
llvm-svn: 34856
2007-03-02 23:15:21 +00:00
Reid Spencer
69858df100
1. Sort switch cases using APInt safe comparison.
...
2. Make sure debug output of APInt values is safe for all bit widths.
llvm-svn: 34855
2007-03-02 23:05:28 +00:00
Reid Spencer
bf4956bcc4
Use APInt safe isOne() method on ConstantInt instead of getZExtValue()==1
...
llvm-svn: 34854
2007-03-02 23:03:17 +00:00
Reid Spencer
0f63188d6a
Make sorting of ConstantInt be APInt clean through use of ult function.
...
llvm-svn: 34853
2007-03-02 23:01:14 +00:00
Reid Spencer
3e3980a403
Fix ashr for bitwidths > 64. This is now validated up to 1024 bits.
...
llvm-svn: 34852
2007-03-02 22:39:11 +00:00
Anton Korobeynikov
af46a0e4a2
Fix uninitialized use of variable. Remove tabs and fix identation.
...
llvm-svn: 34850
2007-03-02 22:19:41 +00:00
Anton Korobeynikov
7cec92bcd2
Simplify things
...
llvm-svn: 34849
2007-03-02 21:50:27 +00:00
Chris Lattner
e11cd0460a
Fix a significant algorithm problem with the instcombine worklist. removing
...
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.
llvm-svn: 34848
2007-03-02 21:28:56 +00:00
Chris Lattner
fb4d1a6437
minor cleanup
...
llvm-svn: 34846
2007-03-02 19:59:19 +00:00
Chris Lattner
68244ce570
Fix PR1234 by working around a compiler bug.
...
llvm-svn: 34845
2007-03-02 18:16:29 +00:00
Evan Cheng
9dddb88209
Mark dead def as unused.
...
llvm-svn: 34844
2007-03-02 10:43:16 +00:00
Evan Cheng
5bd925036c
Dead live-in detection bug.
...
llvm-svn: 34843
2007-03-02 10:41:15 +00:00
Evan Cheng
ce6c3c3004
Add a new test case.
...
llvm-svn: 34842
2007-03-02 10:37:19 +00:00
Evan Cheng
e2802973eb
- Keep track all def and uses of stack slot available in register.
...
- Available value use may be deleted (e.g. noop move).
llvm-svn: 34841
2007-03-02 08:52:00 +00:00
Chris Lattner
afea22c955
testcase for PR1233
...
llvm-svn: 34840
2007-03-02 07:29:59 +00:00
Evan Cheng
622db28794
Invalidate last use of a reused register if the use is a deleted noop copy.
...
llvm-svn: 34839
2007-03-02 05:41:42 +00:00
Chris Lattner
55dcf58453
argument lowering should copy from the vreg shadows of live-in arguments
...
passed in registers, not directly from the pregs themselves.
llvm-svn: 34838
2007-03-02 05:12:29 +00:00
Chris Lattner
e29ef5d9cb
add a note
...
llvm-svn: 34837
2007-03-02 05:04:52 +00:00
Owen Anderson
6d3b179de3
Fix a typo.
...
llvm-svn: 34836
2007-03-02 05:03:07 +00:00
Reid Spencer
6d483da6c0
Use a better algorithm for rounding sqrt results. Change the FIXME about
...
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.
llvm-svn: 34834
2007-03-02 04:21:55 +00:00
Nick Lewycky
29f7380f34
Implement unionWith.
...
llvm-svn: 34833
2007-03-02 03:33:05 +00:00
Chris Lattner
4fbb8286bf
switch the inliner from being recursive to being iterative.
...
llvm-svn: 34832
2007-03-02 03:11:20 +00:00
Reid Spencer
89154fbfff
Fix an unequal bitwidth issue.
...
llvm-svn: 34831
2007-03-02 02:59:25 +00:00
Chris Lattner
889f590aa8
grammaro
...
llvm-svn: 34830
2007-03-02 02:57:34 +00:00
Evan Cheng
44257955c8
Make it 64-bit safe.
...
llvm-svn: 34829
2007-03-02 02:31:37 +00:00
Reid Spencer
39b817765b
Add a FIXME
...
llvm-svn: 34828
2007-03-02 02:01:34 +00:00
Reid Spencer
1be4796f45
Fix a typo.
...
llvm-svn: 34826
2007-03-02 01:31:31 +00:00
Reid Spencer
eabc981a60
Fix a problem where shifting by 64-bits leads to incorrect results on PPC
...
but not on X86 becuase shift by word size is "undefined".
llvm-svn: 34825
2007-03-02 01:19:42 +00:00
Dale Johannesen
a6003a9eb6
eliminate unnecessary reset of SP in epilog on darwin
...
llvm-svn: 34824
2007-03-02 01:17:17 +00:00
Reid Spencer
2814c17704
Reverse a premature commital.
...
llvm-svn: 34822
2007-03-02 00:31:39 +00:00
Reid Spencer
1f970769e8
Prefer non-virtual calls to ConstantInt::isZero over virtual calls to
...
Constant::isNullValue() in situations where it is possible.
llvm-svn: 34821
2007-03-02 00:28:52 +00:00
Reid Spencer
53a673b3ed
Add a non-virtual test for zero, isZero, and rename isUnitValue isOne.
...
These will be used in upcoming patches to avoid virtual function call when
the client knows it is a ConstantInt.
llvm-svn: 34820
2007-03-02 00:27:06 +00:00
Reid Spencer
d86182b19b
Add an abs() function to get the absolute value.
...
llvm-svn: 34819
2007-03-01 23:37:09 +00:00
Reid Spencer
f8f8413839
Combine two lines that can be.
...
llvm-svn: 34818
2007-03-01 23:30:25 +00:00
Reid Spencer
c5d33cef76
Remove virtual keyword from method that doesn't need to be virtual.
...
llvm-svn: 34817
2007-03-01 23:20:52 +00:00
Reid Spencer
ee77d22f26
Make it possible to create an SCEVUnknown from an APInt as well as an int.
...
llvm-svn: 34816
2007-03-01 22:28:51 +00:00
Reid Spencer
e5456dea52
Although probably not necessary, guard against a potential assertion by
...
using isNullValue() instead of getZExtValue() == 0.
llvm-svn: 34815
2007-03-01 21:54:37 +00:00
Reid Spencer
3a7689fe22
Use isUnitValue() instead of getZExtValue() == 1 which will prevent an
...
assert if the ConstantInt's value is large.
llvm-svn: 34814
2007-03-01 21:51:23 +00:00
Reid Spencer
2ce72a4bd8
Add an isUnitValue method for comparison against 1. This just follows a
...
common pattern with isNullValue, isAllOnesValue, etc. It also helps to
prevent things like getZExtValue() == 1, which could assert for large
bitwidths.
llvm-svn: 34813
2007-03-01 21:50:41 +00:00
Owen Anderson
070c37407c
Use GCC intrinsics when available, and use smarter fallbacks when not.
...
llvm-svn: 34812
2007-03-01 21:16:30 +00:00
Reid Spencer
0814741c79
Clarify the use of getValue/getSExtValue/getZExtValue and add the new
...
APInt constructor.
llvm-svn: 34811
2007-03-01 21:05:33 +00:00
Reid Spencer
327ae8b712
Use APInt conversion to string so the result is correct regardless of the
...
bit width of the ConstantInt being converted.
llvm-svn: 34810
2007-03-01 21:00:32 +00:00