Chris Lattner
a12a6de683
move CannotBeNegativeZero to ValueTracking. Simplify some signbit comparisons.
...
llvm-svn: 51864
2008-06-02 01:29:46 +00:00
Chris Lattner
965c769b3c
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
38099c1b6e
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
e625a3b83f
Test for PR2401
...
llvm-svn: 51849
2008-06-01 21:55:55 +00:00
Owen Anderson
d071a8708e
Don't remove the memcpy when call slot substitution fails.
...
llvm-svn: 51848
2008-06-01 21:52:16 +00:00
Owen Anderson
54ea37b9e9
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
b77103b7e4
Make ping more aggressive in finding nonlocal caching errors.
...
llvm-svn: 51845
2008-06-01 20:51:41 +00:00
Chris Lattner
1086ab478d
add a predicate.
...
llvm-svn: 51842
2008-06-01 18:09:04 +00:00
Anton Korobeynikov
10d2f50826
Initialize members properly during construction
...
llvm-svn: 51841
2008-06-01 16:22:49 +00:00
Duncan Sands
0397cd2ec4
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
bdedc148a8
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
fb75d42faa
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
c5156a932e
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
a76f0f7031
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
ca0256abb2
Improved bitcode support for insertvalue/extractvalue.
...
llvm-svn: 51822
2008-05-31 19:11:15 +00:00
Dan Gohman
4b1c1a46a6
Fix a copy+paste error in a comment.
...
llvm-svn: 51821
2008-05-31 19:09:47 +00:00
Dan Gohman
7bb04509f2
Fix some bugs with the handling of indices in insertvalue/extractvalue.
...
llvm-svn: 51820
2008-05-31 19:09:08 +00:00
Nick Lewycky
035fe6f716
Peer through sext/zext when looking for not(cmp).
...
llvm-svn: 51819
2008-05-31 19:01:33 +00:00
Nick Lewycky
69a51cbd6d
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
26b8cd84b3
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
df9242a833
Adding i1 is always Xor.
...
llvm-svn: 51816
2008-05-31 17:10:28 +00:00
Mikhail Glushenkov
f970edf9b7
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
666d664595
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
4e72438ef1
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
bd3390c73a
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
9a19f33842
Remove an unused variable.
...
llvm-svn: 51807
2008-05-31 01:44:25 +00:00
Dan Gohman
1ecaf45cf1
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
215c528565
Revert 51775.
...
llvm-svn: 51795
2008-05-30 22:47:19 +00:00
Dan Gohman
82c85c8435
Add an isAggregateType predicate.
...
llvm-svn: 51794
2008-05-30 22:40:06 +00:00
Evan Cheng
fe3ec48bc4
Fix indentation.
...
llvm-svn: 51793
2008-05-30 22:39:32 +00:00
Evan Cheng
864541aa7b
Fix indentation.
...
llvm-svn: 51792
2008-05-30 22:39:18 +00:00
Dan Gohman
52227dbfdb
Add an operator< for SmallVector.
...
llvm-svn: 51791
2008-05-30 22:37:47 +00:00
Owen Anderson
c5e21e4f38
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
5df4326d78
rewrite operand loops to use iterators
...
llvm-svn: 51789
2008-05-30 21:24:22 +00:00
Mikhail Glushenkov
7640cca259
Make all help strings start in upper case.
...
llvm-svn: 51788
2008-05-30 21:14:10 +00:00
Owen Anderson
8269c9b1c9
Forgot to commit this file.
...
llvm-svn: 51786
2008-05-30 20:14:04 +00:00
Mikhail Glushenkov
b6725054b8
Fix the -opt switch and add a test case for it.
...
llvm-svn: 51784
2008-05-30 19:56:27 +00:00
Mikhail Glushenkov
48b9f4be9d
Fix indentation.
...
llvm-svn: 51782
2008-05-30 18:53:09 +00:00
Mikhail Glushenkov
241042b700
Add a --dry-run option to llvmc2. Patch by Holger Schurig.
...
llvm-svn: 51781
2008-05-30 18:48:52 +00:00
Owen Anderson
e785fb639c
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
1f59d9937f
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
a50833b695
Patches for building llvm on Solaris x86. Contributed by Nathan Keynes.
...
llvm-svn: 51775
2008-05-30 17:16:20 +00:00
Matthijs Kooijman
c9c67157d1
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
57da7d2308
Use eraseFromParent() instead of doing that manually in two places.
...
llvm-svn: 51770
2008-05-30 12:35:46 +00:00
Matthijs Kooijman
bf8d6cefde
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
b0aa651259
Add the "AsCheapAsAMove" flag to some 64-bit xor instructions.
...
llvm-svn: 51761
2008-05-30 06:47:04 +00:00
Mikhail Glushenkov
394620bbd8
Add a --save-temps option.
...
llvm-svn: 51760
2008-05-30 06:29:17 +00:00
Mikhail Glushenkov
401f3d6eab
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
47817cd1a4
Documentation update.
...
llvm-svn: 51758
2008-05-30 06:28:00 +00:00
Mikhail Glushenkov
c03ce6071c
Refactoring: remove code duplication introduced in the previous patch.
...
llvm-svn: 51757
2008-05-30 06:27:29 +00:00