Torok Edwin
cf10ec951d
Fix PR5258, jump-threading creating invalid PHIs.
...
When an incoming value for a PHI is updated, we must also updated all other
incoming values for the same BB to match, otherwise we create invalid PHIs.
llvm-svn: 84638
2009-10-20 15:42:00 +00:00
Torok Edwin
729d92bd74
Fix PR4313: IPSCCP was not setting the lattice value for the invoke instruction
...
when the invoke had multiple return values: it set the lattice value only on the
extractvalue.
This caused the invoke's lattice value to remain the default (undefined), and
later propagated to extractvalue's operand, which incorrectly introduces
undefined behavior.
llvm-svn: 84637
2009-10-20 15:15:09 +00:00
Dan Gohman
8f986672a1
Fix SplitBlockPredecessors' LoopInfo updating code to handle the case
...
where a loop's header is being split and it has predecessors which are not
contained by the most-nested loop which contains the loop.
This fixes PR5235.
llvm-svn: 84505
2009-10-19 16:04:50 +00:00
Chris Lattner
8054401989
remove a now-pointless regtest
...
llvm-svn: 84409
2009-10-18 05:20:17 +00:00
Chris Lattner
00c6ac7bc2
remove testcase for dead pass
...
llvm-svn: 84406
2009-10-18 05:03:41 +00:00
Chris Lattner
f67d297eda
Teach vm core to more aggressively fold 'trunc' constantexprs,
...
allowing it to simplify the crazy constantexprs in the testcases
down to something sensible. This allows -std-compile-opts to
completely "devirtualize" the pointers to member functions in
the testcase from PR5176.
llvm-svn: 84368
2009-10-17 21:53:27 +00:00
Chris Lattner
6f463f9ad4
remove # uses from FileCheck lines.
...
llvm-svn: 84367
2009-10-17 21:51:19 +00:00
Chris Lattner
965fe98af6
rename test
...
llvm-svn: 84364
2009-10-17 21:31:19 +00:00
Chris Lattner
88b36f1140
Simplify some code (first hunk) and fix PR5208 (second hunk) by
...
updating the callgraph when introducing a call.
llvm-svn: 84310
2009-10-17 05:39:39 +00:00
Victor Hernandez
c7d6a8327c
Autoupgrade malloc insts to malloc calls.
...
Update testcases that rely on malloc insts being present.
Also prematurely remove MallocInst handling from IndMemRemoval and RaiseAllocations to help pass tests in this incremental step.
llvm-svn: 84292
2009-10-17 00:00:19 +00:00
Victor Hernandez
264da3274e
HeapAllocSRoA also needs to check if malloc array size can be computed.
...
llvm-svn: 84288
2009-10-16 23:12:25 +00:00
Victor Hernandez
c81923e07c
Invert isSafeToGetMallocArraySize check because we return NULL when we don't know the size.
...
Thanks to Duncan Sands for noticing this bug.
llvm-svn: 84260
2009-10-16 18:07:17 +00:00
Duncan Sands
de3f2c26c6
Check that GVN performs this transform even if the calls
...
themselves are not marked readonly, but only the called
functions.
llvm-svn: 84253
2009-10-16 12:18:23 +00:00
Chris Lattner
6b9044db01
make instcombine's instruction sinking more aggressive in the
...
presence of PHI nodes.
llvm-svn: 84103
2009-10-14 15:21:58 +00:00
Chris Lattner
19788ca686
change simplifycfg to not duplicate 'unwind' instructions. Hopefully
...
this will increase the likelihood of common code getting sunk towards
the unwind.
llvm-svn: 83996
2009-10-13 18:13:05 +00:00
Chris Lattner
8d6d09379d
convert to filecheck
...
llvm-svn: 83995
2009-10-13 18:10:05 +00:00
Chris Lattner
6f55a81bb9
rename test
...
llvm-svn: 83994
2009-10-13 18:08:21 +00:00
Victor Hernandez
70e8505eb1
Memory dependence analysis was incorrectly stopping to scan for stores to a pointer at bitcast uses of a malloc call.
...
It should continue scanning until the malloc call, and this patch fixes that.
llvm-svn: 83931
2009-10-13 01:42:53 +00:00
Edward O'Callaghan
1c591f74c7
Missing CHECK: lines makes test exit abnormally.
...
llvm-svn: 83835
2009-10-12 09:01:26 +00:00
Edward O'Callaghan
8720e8c8f3
FileCheck not CheckFile, oops.
...
llvm-svn: 83834
2009-10-12 08:51:28 +00:00
Edward O'Callaghan
6d01608662
Convert InstCombine/call.ll to CheckFile.
...
llvm-svn: 83833
2009-10-12 08:46:47 +00:00
Edward O'Callaghan
cbf75a5dc3
Convert the rest of the InstCombine tests from notcast to FileCheck.
...
llvm-svn: 83828
2009-10-12 07:18:14 +00:00
Nick Lewycky
31a57ea0dd
Remove this part of the test, it never actually tested anything anyways. This
...
unbreaks make check after evocallaghan's changes.
llvm-svn: 83827
2009-10-12 06:32:42 +00:00
Edward O'Callaghan
940da903e2
Fix syntax error missed in converting zext.ll test. Convert 2003-11-13-ConstExprCastCall.ll to FileCheck from notcast.
...
llvm-svn: 83826
2009-10-12 06:23:56 +00:00
Edward O'Callaghan
484b6c2cfc
Convert InstCombine tests from notcast to FileCheck.
...
llvm-svn: 83825
2009-10-12 06:14:06 +00:00
Chris Lattner
06462efb47
reduce vec_shuffle2 and merge into vec_shuffle.
...
llvm-svn: 83807
2009-10-11 22:54:48 +00:00
Chris Lattner
6373045e7d
filecheckize vec_shuffle.ll and merge shuffle.ll into it.
...
llvm-svn: 83806
2009-10-11 22:52:15 +00:00
Chris Lattner
79a2f91f65
filecheckize
...
llvm-svn: 83805
2009-10-11 22:45:17 +00:00
Chris Lattner
8308fd9aab
rename test
...
llvm-svn: 83804
2009-10-11 22:44:16 +00:00
Chris Lattner
e660ee0a3b
remove old testcase
...
llvm-svn: 83803
2009-10-11 22:42:06 +00:00
Chris Lattner
1fe15dbbbb
merge test into shift.ll, this also eliminates awful grepping on -stats output
...
llvm-svn: 83802
2009-10-11 22:39:58 +00:00
Chris Lattner
d7969a2796
convert to filecheck.
...
llvm-svn: 83801
2009-10-11 22:36:59 +00:00
Chris Lattner
c6cdbfbfdd
teach instcombine to simplify xor's harder, catching the
...
new testcase.
llvm-svn: 83799
2009-10-11 22:22:13 +00:00
Chris Lattner
7db5b7893d
convert xor2 to filecheck, merge in a random regtest
...
llvm-svn: 83796
2009-10-11 21:42:08 +00:00
Chris Lattner
fd27f8a5b3
generalize a transformation even more: we don't care whether the
...
input the the mul is a zext from bool, just that it is all zeros
other than the low bit. This fixes some phase ordering issues
that would cause us to miss some xforms in mul.ll when the worklist
is visited differently.
llvm-svn: 83794
2009-10-11 21:29:45 +00:00
Chris Lattner
406cb75c6b
simplify a transformation by making it more general.
...
llvm-svn: 83792
2009-10-11 21:22:21 +00:00
Torok Edwin
907ec36943
LICM shouldn't sink/delete debug information. Fix this and add a testcase.
...
For now the metadata of sinked/hoisted instructions is still wrong, but that'll
be fixed when instructions will have debug metadata directly attached.
llvm-svn: 83786
2009-10-11 19:15:54 +00:00
Chris Lattner
85c85c5e04
when folding duplicate conditions, delete the
...
now-probably-dead instruction tree feeding it.
llvm-svn: 83778
2009-10-11 18:39:58 +00:00
Chris Lattner
e374382b8f
implement rdar://7293527, a trivial instcombine that llvm-gcc
...
gets but clang doesn't, because it is implemented in GCC's
fold routine.
llvm-svn: 83761
2009-10-11 07:53:15 +00:00
Chris Lattner
97b1405207
implement a transformation in jump threading that is currently
...
done by condprop, but do it in a much more general form. The
basic idea is that we can do a limited form of tail duplication
in the case when we have a branch on a phi. Moving the branch
up in to the predecessor block makes instruction selection
much easier and encourages chained jump threadings.
llvm-svn: 83759
2009-10-11 07:24:57 +00:00
Chris Lattner
4140d8bd5c
another testcase jump threading shouldn't crash on.
...
llvm-svn: 83758
2009-10-11 07:11:11 +00:00
Chris Lattner
ece16f2335
rename a file, remove a poorly reduced testcase.
...
llvm-svn: 83757
2009-10-11 07:10:28 +00:00
Chris Lattner
f99a74e24b
make jump threading on a phi with undef inputs happen.
...
llvm-svn: 83754
2009-10-11 04:18:15 +00:00
Chris Lattner
8d186bfafb
merge two tests.
...
llvm-svn: 83751
2009-10-11 03:55:30 +00:00
Chris Lattner
041c1dca8b
simplify some run lines, convert a test to filecheck.
...
llvm-svn: 83750
2009-10-11 03:54:21 +00:00
Chris Lattner
b6c65faa64
switch GVN to use SSAUpdater. Besides removing a lot of complexity
...
from GVN, this also speeds it up, inserts fewer PHI nodes (see the
testcase) and allows it to remove more loads (due to fewer PHI nodes
standing in the way).
llvm-svn: 83746
2009-10-10 23:50:30 +00:00
Dale Johannesen
3059924bdd
When considering whether to inline Callee into Caller,
...
and that will make Caller too big to inline, see if it
might be better to inline Caller into its callers instead.
This situation is described in PR 2973, although I haven't
tried the specific case in SPASS.
llvm-svn: 83602
2009-10-09 00:11:32 +00:00
Chris Lattner
a893f5bdf5
remove predicate simplifier, it never got the last bugs beaten
...
out of it, and jump threading, condprop and gvn are now getting
most of the benefit. This was approved by Nicholas and Nicolas.
llvm-svn: 83390
2009-10-06 16:59:46 +00:00
Evan Phoenix
44e5dbcaf0
Extend ConstantFolding to understand signed overflow variants
...
llvm-svn: 83338
2009-10-05 22:53:52 +00:00
Chris Lattner
59d939894b
teach the optimizer how to constant fold uadd/usub intrinsics.
...
llvm-svn: 83295
2009-10-05 05:26:04 +00:00