Andreas Neustifter
e70972f8d5
Cheap, mostly strict, stable sorting.
...
This is necessary for tests so the results are comparable.
llvm-svn: 90320
2009-12-02 15:57:15 +00:00
Owen Anderson
f47cde694f
Cleanup/remove some parts of the lifetime region handling code in memdep and GVN,
...
per Chris' comments. Adjust testcases to match.
llvm-svn: 90304
2009-12-02 07:35:19 +00:00
Chris Lattner
b541c63e60
factor some code better.
...
llvm-svn: 90299
2009-12-02 06:44:58 +00:00
Chris Lattner
90aff65316
formatting cleanups.
...
llvm-svn: 90298
2009-12-02 06:35:55 +00:00
Chris Lattner
cb2c4e9f42
tidy up, remove dependence on order of evaluation of function args from EmitMemCpy.
...
llvm-svn: 90297
2009-12-02 06:05:42 +00:00
Chris Lattner
7c0c90df97
fix PR5640 by tracking whether a block is the header of a loop more
...
precisely, which prevents us from infinitely peeling the loop.
llvm-svn: 90211
2009-12-01 06:04:43 +00:00
Benjamin Kramer
d9780ec7c5
Revert r90089 for now, it's breaking selfhost.
...
llvm-svn: 90097
2009-11-29 21:17:48 +00:00
Benjamin Kramer
a1d24b5a8d
Fix two FIXMEs.
...
llvm-svn: 90089
2009-11-29 20:29:30 +00:00
Chris Lattner
cd6fed25d5
add testcases for the foo_with_overflow op xforms added recently and
...
fix bugs exposed by the tests. Testcases from Alastair Lynn!
llvm-svn: 90056
2009-11-29 02:57:29 +00:00
Chris Lattner
d48ff7ea6a
Implement PR5634.
...
llvm-svn: 90046
2009-11-29 00:51:17 +00:00
Chris Lattner
83284453a1
reenable load address insertion in load pre. This allows us to
...
handle cases like this:
void test(int N, double* G) {
long j;
for (j = 1; j < N - 1; j++)
G[j+1] = G[j] + G[j+1];
}
where G[1] isn't live into the loop.
llvm-svn: 90041
2009-11-28 16:08:18 +00:00
Chris Lattner
f8d8142a06
Enhance InsertPHITranslatedPointer to be able to return a list of newly
...
inserted instructions. No functionality change until someone starts using it.
llvm-svn: 90039
2009-11-28 15:39:14 +00:00
Chris Lattner
f3e5cbfc99
disable value insertion for now, I need to figure out how
...
to inform GVN about the newly inserted values. This fixes
PR5631.
llvm-svn: 90022
2009-11-27 22:50:07 +00:00
Chris Lattner
73b425ba51
Rework InsertPHITranslatedPointer to handle the recursive case, this
...
fixes PR5630 and sets the stage for the next phase of goodness (testcase
pending).
llvm-svn: 90019
2009-11-27 22:05:15 +00:00
Chris Lattner
bdaed088ea
factor some logic out of instcombine into a new SimplifyAddInst method.
...
llvm-svn: 90011
2009-11-27 17:42:22 +00:00
Chris Lattner
cdfa9dadf1
fix PR5436 by making the 'simple' case of SRoA not promote out of range
...
array indexes. The "complex" case of SRoA still handles them, and correctly.
This fixes a weirdness where we'd correctly avoid transforming A[0][42] if
the 42 was too large, but we'd only do it if it was one gep, not two separate
ones.
llvm-svn: 90007
2009-11-27 16:37:41 +00:00
Chris Lattner
a466dbe80a
teach GVN's load PRE to insert computations of the address in predecessors
...
where it is not available. It's unclear how to get this inserted
computation into GVN's scalar availability sets, Owen, help? :)
llvm-svn: 89997
2009-11-27 08:25:10 +00:00
Chris Lattner
0971e6da1f
Fix phi translation in load PRE to agree with the phi
...
translation done by memdep, and reenable gep translation
again.
llvm-svn: 89992
2009-11-27 06:31:14 +00:00
Chris Lattner
6611a6f733
factor some instcombine simplifications for getelementptr out to a new
...
SimplifyGEPInst method in InstructionSimplify.h. No functionality change.
llvm-svn: 89980
2009-11-27 00:29:05 +00:00
Chris Lattner
e949f49b23
fix crash on Transforms/InstCombine/intrinsics.ll introduced by r89970
...
llvm-svn: 89972
2009-11-26 22:08:06 +00:00
Chris Lattner
cf7665b0c8
Fix PR5471 by removing an instcombine xform. Some pieces of the code
...
generates store to undef and some generates store to null as the idiom
for undefined behavior. Since simplifycfg zaps both, don't remove the
undefined behavior in instcombine.
llvm-svn: 89971
2009-11-26 22:04:42 +00:00
Chris Lattner
08e20f453d
implement a bunch of xforms for overflow intrinsics, based on a patch
...
by Alastair Lynn.
llvm-svn: 89970
2009-11-26 21:42:47 +00:00
Edward O'Callaghan
4b197b8908
Reverting patch in revision 89758, initial attempt at fixing PR5373 has proven to be bogus.
...
llvm-svn: 89844
2009-11-25 05:38:41 +00:00
Edward O'Callaghan
8c1cd4fdbc
Fix for PR5373, Credit to Jakub Staszak.
...
llvm-svn: 89758
2009-11-24 11:51:52 +00:00
Dan Gohman
58bb87921b
Make ConstantFoldConstantExpression recursively visit the entire
...
ConstantExpr, not just the top-level operator. This allows it to
fold many more constants.
Also, make GlobalOpt call ConstantFoldConstantExpression on
GlobalVariable initializers.
llvm-svn: 89659
2009-11-23 16:22:21 +00:00
Dan Gohman
0ef3e7cf76
Fix a use of an invalidated iterator in the case where there are multiple
...
adjacent uses of a dead basic block from the same user. This fixes PR5596.
llvm-svn: 89658
2009-11-23 16:13:39 +00:00
Nick Lewycky
b3bedf4b2d
Pull LLVMContext out of PromoteMemToReg.
...
llvm-svn: 89645
2009-11-23 03:50:44 +00:00
Nick Lewycky
76fbcdaaa7
Remove LLVMContext and its include.
...
llvm-svn: 89644
2009-11-23 03:34:29 +00:00
Nick Lewycky
8cbd0c3156
Remove unused LLVMContext.
...
llvm-svn: 89642
2009-11-23 03:29:18 +00:00
Nick Lewycky
9d1ee635e3
Reapply r88830 with a bugfix: this transform only applies to icmp eq/ne. This
...
fixes part of PR5438.
llvm-svn: 89639
2009-11-23 03:17:33 +00:00
Eric Christopher
455f4d8400
Add more optimizations for object size checking, enable handling of
...
object size intrinsic and verify return type is correct. Collect various
code in one place.
llvm-svn: 89523
2009-11-21 01:01:30 +00:00
Dan Gohman
d115107ef2
Make Loop::getLoopLatch() work on loops which don't have preheaders, as
...
it may be used in contexts where preheader insertion may have failed due
to an indirectbr.
Make LoopSimplify's LoopSimplify::SeparateNestedLoop properly fail in
the case that it would require splitting an indirectbr edge.
These fix PR5502.
llvm-svn: 89484
2009-11-20 20:51:18 +00:00
Dan Gohman
94cca19d9d
Fix IPSCCP's code for deleting dead blocks to tolerate outstanding
...
blockaddress users. This fixes PR5569.
llvm-svn: 89483
2009-11-20 20:19:14 +00:00
Daniel Dunbar
09a7f92b02
Revert "Add some rough optimizations for checking routines.", it buildeth not.
...
llvm-svn: 89482
2009-11-20 20:17:30 +00:00
Eric Christopher
61485dfd00
Add some rough optimizations for checking routines.
...
llvm-svn: 89479
2009-11-20 19:57:37 +00:00
Duncan Sands
5f5ec2a6ec
Fix PR5563, an expensive checks failure when running on
...
tests/Transforms/InstCombine/shufflemask-undef.ll. If
anyone cares, the use of 2*e here (and the equivalent
all over the place in instcombine) seems wrong, though
harmless: it should really be twice the length of the
input vector. I think shufflevector used to require
that the mask have the same length as the input, but I
don't think that's true any more. I don't care enough
about vectors to do anything about this...
llvm-svn: 89456
2009-11-20 13:19:51 +00:00
Dan Gohman
44ddc50043
Extend CaptureTracking to indicate when a value is never stored, even
...
if it is not ultimately captured. Teach BasicAliasAnalysis that a
local object address which does not escape and is never stored does
not alias with a value resulting from a load.
llvm-svn: 89398
2009-11-19 21:57:48 +00:00
Dan Gohman
026230b0a9
Enable hoisting of loads from constant memory by default. In cases where
...
they are lowered to instruction sequences more complex than a simple
load, such that CodeGen cannot rematerialize them, a reload from a
spill slot is likely to be cheaper than the complex sequence.
llvm-svn: 89374
2009-11-19 19:00:10 +00:00
Jim Grosbach
f5f954f888
Eliminate duplicate phi nodes in loops. Loop rotation, for example, can introduce these, and it's beneficial to later passes to clean them up.
...
llvm-svn: 89298
2009-11-19 02:03:18 +00:00
Jim Grosbach
5787c6eb88
Make EliminateDuplicatePHINodes() available as a utility function
...
llvm-svn: 89297
2009-11-19 02:02:10 +00:00
Jim Grosbach
2853c74dc9
grammar
...
llvm-svn: 89145
2009-11-17 21:37:04 +00:00
Jim Grosbach
1aa8f6c5c7
80-column violations
...
llvm-svn: 89123
2009-11-17 19:05:35 +00:00
Evan Cheng
aaa58b7653
Generalize OptimizeLoopTermCond to optimize more loop terminating icmp to use postinc iv.
...
llvm-svn: 89116
2009-11-17 18:10:11 +00:00
Jim Grosbach
5851dbf184
Remove trailing whitespace
...
llvm-svn: 89110
2009-11-17 17:53:56 +00:00
Devang Patel
04a40c8ff7
Remove debug info attached with an instruction.
...
llvm-svn: 89016
2009-11-17 00:47:06 +00:00
David Greene
47e8728c22
Fix an expensive-checks error.
...
The Mask and LHSMask may not be of the same size, so don't do the
transformation if they're different.
llvm-svn: 88972
2009-11-16 21:52:23 +00:00
Duncan Sands
03e15012ed
CreateIntCast takes an "isSigned" parameter. Pass "true" for it, rather than
...
a name.
llvm-svn: 88908
2009-11-16 12:32:28 +00:00
Chris Lattner
15cd19dddb
make PRE of loads preserve the alignment of the moved load instruction.
...
llvm-svn: 88865
2009-11-15 19:58:31 +00:00
Chris Lattner
59f69de88f
fix a bug handling 'not x' when x is undef.
...
llvm-svn: 88864
2009-11-15 19:57:43 +00:00
Nick Lewycky
f05946faff
Revert r88830 and r88831 which appear to have caused a selfhost buildbot some
...
grief. I suspect this patch merely exposed a bug else.
llvm-svn: 88841
2009-11-15 07:47:32 +00:00