Chris Lattner
ea60f0ccc3
move CannotBeNegativeZero to ValueTracking. Simplify some signbit comparisons.
...
llvm-svn: 51864
2008-06-02 01:29:46 +00:00
Chris Lattner
4960857273
move ComputeMaskedBits, MaskedValueIsZero, and ComputeNumSignBits
...
out of instcombine into a new file in libanalysis. This also teaches
ComputeNumSignBits about the number of sign bits in a constantint.
llvm-svn: 51863
2008-06-02 01:18:21 +00:00
Owen Anderson
7700de3137
Fix two issues that Eli Friedman pointed out, where would misoptimized code like:
...
char a[200];
init(a, a+200);
OR
int a[200];
char* b = (char*)a;
char* c = (char*)a;
foo(b, c);
llvm-svn: 51850
2008-06-01 22:26:26 +00:00
Owen Anderson
d194f76cb4
Test for PR2401
...
llvm-svn: 51849
2008-06-01 21:55:55 +00:00
Owen Anderson
00e422b2ea
Don't remove the memcpy when call slot substitution fails.
...
llvm-svn: 51848
2008-06-01 21:52:16 +00:00
Owen Anderson
ee111c28b8
Remember to update the reverse non-local cache when cleaning up dirty entries. This fixes PR2397.
...
llvm-svn: 51846
2008-06-01 21:03:52 +00:00
Owen Anderson
67a1d5ec35
Make ping more aggressive in finding nonlocal caching errors.
...
llvm-svn: 51845
2008-06-01 20:51:41 +00:00
Chris Lattner
0e6bb31def
add a predicate.
...
llvm-svn: 51842
2008-06-01 18:09:04 +00:00
Anton Korobeynikov
4cdd9d48ac
Initialize members properly during construction
...
llvm-svn: 51841
2008-06-01 16:22:49 +00:00
Duncan Sands
d14212a3e1
When simplifying a call to a bitcast function, tighten up
...
the conditions for performing the transform when only the
function declaration is available: no longer allow turning
i32 into i64 for example. Only allow changing between
pointer types, and between pointer types and integers of
the same size. For return values ptr -> intptr was already
allowed; I added ptr -> ptr and intptr -> ptr while there.
As shown by a recent objc testcase, changing the way
parameters/return values are passed can be fatal when calling
code written in assembler that directly manipulates call
arguments and return values unless the transform has no
impact on the way they are passed at the codegen level.
While it is possible to imagine an ABI that treats integers
of pointer size differently to pointers, I don't think LLVM
supports any so the transform should now be safe while still
being useful.
llvm-svn: 51834
2008-06-01 07:38:42 +00:00
Bruno Cardoso Lopes
e5b4a0d794
Fixed flag issue that was generating infinite loop while in list scheduling.
...
llvm-svn: 51833
2008-06-01 03:49:39 +00:00
Nick Lewycky
8331fc08d8
Add a standard for control-flow unreachable assertions in functions that return
...
values, so as to avoid warnings on some platforms.
llvm-svn: 51831
2008-05-31 23:54:55 +00:00
Chris Lattner
da1e2c8fa3
update this patch to handle an extraneous &1. This should be pulled
...
into the 2.3 release branch.
llvm-svn: 51824
2008-05-31 19:50:53 +00:00
Dan Gohman
06d49b3c5b
AsmWriter support for insertvalue/extractvalue. These instructions can
...
now round-trip through assembly and bitcode.
llvm-svn: 51823
2008-05-31 19:12:39 +00:00
Dan Gohman
1e195a735e
Improved bitcode support for insertvalue/extractvalue.
...
llvm-svn: 51822
2008-05-31 19:11:15 +00:00
Dan Gohman
9ca8f65a00
Fix a copy+paste error in a comment.
...
llvm-svn: 51821
2008-05-31 19:09:47 +00:00
Dan Gohman
caa9c6e94d
Fix some bugs with the handling of indices in insertvalue/extractvalue.
...
llvm-svn: 51820
2008-05-31 19:09:08 +00:00
Nick Lewycky
1bcd80adf7
Peer through sext/zext when looking for not(cmp).
...
llvm-svn: 51819
2008-05-31 19:01:33 +00:00
Nick Lewycky
566baa2c72
Yay us! Every one of these examples turns into icmp/zext/ret.
...
llvm-svn: 51818
2008-05-31 18:20:26 +00:00
Nick Lewycky
b30afdb62b
Add more i1 optimizations. add, sub, mul, s/udiv on i1 are now simplified away.
...
llvm-svn: 51817
2008-05-31 17:59:52 +00:00
Nick Lewycky
cdcdcddc85
Adding i1 is always Xor.
...
llvm-svn: 51816
2008-05-31 17:10:28 +00:00
Mikhail Glushenkov
611c1b0f47
Callback was not executed on OS X when it was a function.
...
llvm-svn: 51814
2008-05-31 13:43:21 +00:00
Chris Lattner
43a47ddd89
Fix the CBE's handling of instructions whose result is an i1. Previously,
...
we did not truncate the value down to i1 with (x&1). This caused a problem
when the computation of x was nontrivial, for example, "add i1 1, 1" would
return 2 instead of 0.
This makes the testcase compile into:
...
llvm_cbe_t = (((llvm_cbe_r == 0u) + (llvm_cbe_r == 0u))&1);
llvm_cbe_u = (((unsigned int )(bool )llvm_cbe_t));
...
instead of:
...
llvm_cbe_t = ((llvm_cbe_r == 0u) + (llvm_cbe_r == 0u));
llvm_cbe_u = (((unsigned int )(bool )llvm_cbe_t));
...
This fixes a miscompilation of mediabench/adpcm/rawdaudio/rawdaudio and
403.gcc with the CBE, regressions from LLVM 2.2. Tanya, please pull
this into the release branch.
llvm-svn: 51813
2008-05-31 09:23:55 +00:00
Dan Gohman
1ab21af8e0
Factor several methods, including getInversePredicate and
...
getSwappedPredicate, from ICmpInst and FCmpInst into common
methods in CmpInst. This allows CmpInsts to be manipulated
generically.
llvm-svn: 51810
2008-05-31 02:47:54 +00:00
Dan Gohman
00823cb0d4
Teach the DAGISelEmitter to not compute the variable_ops operand
...
index for the input pattern in terms of the output pattern. Instead
keep track of how many fixed operands the input pattern actually
has, and have the input matching code pass the output-emitting
function that index value. This simplifies the code, disentangles
variables_ops from the support for predication operations, and
makes variable_ops more robust.
llvm-svn: 51808
2008-05-31 02:11:25 +00:00
Dan Gohman
0ae2954dd5
Remove an unused variable.
...
llvm-svn: 51807
2008-05-31 01:44:25 +00:00
Dan Gohman
ac5c3382fe
IR, bitcode reader, bitcode writer, and asmparser changes to
...
insertvalue and extractvalue to use constant indices instead of
Value* indices. And begin updating LangRef.html.
There's definately more to come here, but I'm checking this
basic support in now to make it available to people who are
interested.
llvm-svn: 51806
2008-05-31 00:58:22 +00:00
Evan Cheng
ce2c3b07ba
Revert 51775.
...
llvm-svn: 51795
2008-05-30 22:47:19 +00:00
Dan Gohman
32c27bdfc4
Add an isAggregateType predicate.
...
llvm-svn: 51794
2008-05-30 22:40:06 +00:00
Evan Cheng
ee4a0719c0
Fix indentation.
...
llvm-svn: 51793
2008-05-30 22:39:32 +00:00
Evan Cheng
f1fb1d7abf
Fix indentation.
...
llvm-svn: 51792
2008-05-30 22:39:18 +00:00
Dan Gohman
b67e96f3aa
Add an operator< for SmallVector.
...
llvm-svn: 51791
2008-05-30 22:37:47 +00:00
Owen Anderson
65cfda30bd
The coalescer doesn't need LiveVariables now that we have register use iterators.
...
llvm-svn: 51790
2008-05-30 22:37:27 +00:00
Gabor Greif
d931decf37
rewrite operand loops to use iterators
...
llvm-svn: 51789
2008-05-30 21:24:22 +00:00
Mikhail Glushenkov
dd905591da
Make all help strings start in upper case.
...
llvm-svn: 51788
2008-05-30 21:14:10 +00:00
Owen Anderson
d5fc134ec6
Forgot to commit this file.
...
llvm-svn: 51786
2008-05-30 20:14:04 +00:00
Mikhail Glushenkov
9db02580c5
Fix the -opt switch and add a test case for it.
...
llvm-svn: 51784
2008-05-30 19:56:27 +00:00
Mikhail Glushenkov
da5109acd4
Fix indentation.
...
llvm-svn: 51782
2008-05-30 18:53:09 +00:00
Mikhail Glushenkov
23bd8d1eb2
Add a --dry-run option to llvmc2. Patch by Holger Schurig.
...
llvm-svn: 51781
2008-05-30 18:48:52 +00:00
Owen Anderson
9ba2e2794e
Preserve the register coallescer, and update live intervals more correctly by triggering a renumbering after phi elimination.
...
llvm-svn: 51780
2008-05-30 18:38:26 +00:00
Owen Anderson
40022e00ef
Since LCSSA switched over to DenseMap, we have to be more careful to avoid iterator invalidation. Fixes PR2385.
...
llvm-svn: 51777
2008-05-30 17:31:01 +00:00
Evan Cheng
8ebaae9d1c
Patches for building llvm on Solaris x86. Contributed by Nathan Keynes.
...
llvm-svn: 51775
2008-05-30 17:16:20 +00:00
Matthijs Kooijman
9fc9250ec0
Give a proper error message when a command line option is defined more than
...
once (ie, at two different places in the source, not two times on the
commandline).
llvm-svn: 51771
2008-05-30 13:26:11 +00:00
Matthijs Kooijman
861df1986d
Use eraseFromParent() instead of doing that manually in two places.
...
llvm-svn: 51770
2008-05-30 12:35:46 +00:00
Matthijs Kooijman
32c5d3a9ee
Let Instruction::getOpcodeName() return something useful for the new
...
insertvalue / extractvalue instructions.
llvm-svn: 51766
2008-05-30 10:31:54 +00:00
Bill Wendling
244b4db58d
Add the "AsCheapAsAMove" flag to some 64-bit xor instructions.
...
llvm-svn: 51761
2008-05-30 06:47:04 +00:00
Mikhail Glushenkov
de53ad5a62
Add a --save-temps option.
...
llvm-svn: 51760
2008-05-30 06:29:17 +00:00
Mikhail Glushenkov
fd530e8c6a
Add a check for side effect-free options (specified only in the OptionList).
...
llvm-svn: 51759
2008-05-30 06:28:37 +00:00
Mikhail Glushenkov
c90efd29e5
Documentation update.
...
llvm-svn: 51758
2008-05-30 06:28:00 +00:00
Mikhail Glushenkov
8d77c1749d
Refactoring: remove code duplication introduced in the previous patch.
...
llvm-svn: 51757
2008-05-30 06:27:29 +00:00