1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

39086 Commits

Author SHA1 Message Date
Devang Patel
390d72740e Add debugging aid.
llvm-svn: 51891
2008-06-03 01:02:16 +00:00
Dan Gohman
5c60e1fdff Fix whitespace in whitespace-significant pseudocode in a comment.
llvm-svn: 51890
2008-06-03 00:57:21 +00:00
Dan Gohman
fbf0f6cf8e Constant folding for insertvalue and extractvalue.
llvm-svn: 51889
2008-06-03 00:15:20 +00:00
Devang Patel
b1798d2be0 Update dom tree. Fix PR 2372.
llvm-svn: 51887
2008-06-02 22:52:56 +00:00
Dan Gohman
626f8e4454 Fold adds and subtracts of zero immediately, instead of waiting
for dagcombine to do this.

llvm-svn: 51886
2008-06-02 22:27:05 +00:00
Scott Michel
3918ece044 Minor cosmetic patch so that the hex equivalent of a decimal
constant shows up in the assembly language output. Helps with
debugging without a HP calculator having to be handy.

llvm-svn: 51885
2008-06-02 22:19:12 +00:00
Scott Michel
5323d58281 Add necessary 64-bit support so that gcc frontend compiles (mostly). Current
issue is operand promotion for setcc/select... but looks like the fundamental
stuff is implemented for CellSPU.

llvm-svn: 51884
2008-06-02 22:18:03 +00:00
Dan Gohman
5a9c2a3434 Implement CBE support for first-class structs and array values,
and insertvalue and extractvalue instructions.

First-class array values are not trivial because C doesn't
support them. The approach I took here is to wrap all arrays
in structs. Feedback is welcome.

The 2007-01-15-NamedArrayType.ll test needed to be modified
because it has a "not grep" for a string that now exists,
because array types now have associated struct types, and
those struct types have names.

llvm-svn: 51881
2008-06-02 21:30:49 +00:00
Dan Gohman
0af6616fbb Update the polygen grammer for the new insertvalue and extractvalue syntax.
llvm-svn: 51879
2008-06-02 19:47:09 +00:00
Chris Lattner
3e1cd5c9bf Remove unneeded code I added.
llvm-svn: 51878
2008-06-02 18:39:07 +00:00
Dan Gohman
385b7d76ed Fix the position of MemOperands in nodes that use variadic_ops
in DAGISelEmitter output. This bug was recently uncovered by the
addition of patterns for CALL32m and CALL64m, which are nodes
that now have both MemOperands and variadic_ops.

This bug was especially visible with PIC in various configurations,
because the new patterns are matching the indirect call code used
in many PIC configurations.

llvm-svn: 51877
2008-06-02 17:40:38 +00:00
Owen Anderson
54660d1fcf Correctly handle removed instructions at the beginning of MBBs when renumbering.
llvm-svn: 51876
2008-06-02 17:36:36 +00:00
Wojciech Matyjewicz
06e4c8a420 Fixes PR2395. Looking for a constant in a GEP tail (when the first GEP
is longer than the second one) should stop after finding one. Added break 
instruction guarantees it. It also changes difference between offsets to 
absolute value of this difference in the condition.

llvm-svn: 51875
2008-06-02 17:26:12 +00:00
Steve Naroff
e79dd8c21a update vc configure project for renaming of
hash_map/hash_set/iterator to have a .h suffix.

llvm-svn: 51867
2008-06-02 16:37:36 +00:00
Rafael Espindola
feec40a71f Don't use the GOT for symbols that are not externally visible.
llvm-svn: 51865
2008-06-02 07:52:43 +00:00
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