Andrew Trick
b4cabec37a
Missing test case for r141164.
...
llvm-svn: 141166
2011-10-05 06:23:32 +00:00
Nick Lewycky
4898eef762
Reapply r140979 with fix! We never did get a testcase, but careful review of the
...
logic by David Meyer revealed this bug.
llvm-svn: 140992
2011-10-03 07:10:45 +00:00
Nick Lewycky
79fec8116f
Revert r140979 due to reports of bootstrap failure.
...
llvm-svn: 140980
2011-10-03 05:14:59 +00:00
Nick Lewycky
a760a29395
Add one more case we compute a max trip count.
...
llvm-svn: 140979
2011-10-03 01:03:57 +00:00
Andrew Trick
fe292d43c0
This test only makes sense with -enable-iv-rewrite.
...
llvm-svn: 139576
2011-09-13 02:45:26 +00:00
Nick Lewycky
8203bcfd03
This transform only handles two-operand AddRec's. Prevent it from trying to
...
handle anything more complex. Fixes PR10383 again!
llvm-svn: 139186
2011-09-06 21:42:18 +00:00
Nick Lewycky
3823432a57
The logic inside getMulExpr to simplify {a,+,b}*{c,+,d} was wrong, which was
...
visible given a=b=c=d=1, on iteration #1 (the second iteration). Replace it with
correct math. Fixes PR10383!
llvm-svn: 139133
2011-09-06 05:05:14 +00:00
Nick Lewycky
18c0b01a56
Revert r139126 due to selfhost failures reported by buildbots.
...
llvm-svn: 139130
2011-09-06 02:43:13 +00:00
Nick Lewycky
30dcc754df
Teach SCEV to report a max backedge count in one interesting case in
...
HowFarToZero; the case for a canonical loop.
llvm-svn: 139126
2011-09-05 23:25:16 +00:00
Chris Lattner
6aa403748e
Remove support for parsing the "type i32" syntax for defining a numbered
...
top level type without a specified number. This syntax isn't documented
and blocks forward progress.
llvm-svn: 133371
2011-06-19 00:03:46 +00:00
Chris Lattner
ad5400fa72
rip out a ton of intrinsic modernization logic from AutoUpgrade.cpp, which is
...
for pre-2.9 bitcode files. We keep x86 unaligned loads, movnt, crc32, and the
target indep prefetch change.
As usual, updating the testsuite is a PITA.
llvm-svn: 133337
2011-06-18 06:05:24 +00:00
Chris Lattner
4eb6f76fa6
Remove support for using "foo" as symbols instead of %"foo". This is ancient
...
syntax and has been long obsolete. As usual, updating the tests is the nasty
part of this.
llvm-svn: 133242
2011-06-17 06:36:20 +00:00
Andrew Trick
cef977b295
Test case and comment for PR9633.
...
llvm-svn: 130294
2011-04-27 05:42:17 +00:00
Andrew Trick
5c8b815e5f
Propagate SCEV no-wrap flags whenever possible.
...
This needs review.
llvm-svn: 127638
2011-03-15 00:37:00 +00:00
Andrew Trick
c4703f6ea1
When SCEV can determine the loop test is X < X, set ExactBECount=0.
...
When ExactBECount is a constant, use it for MaxBECount.
When MaxBECount cannot be computed, replace it with ExactBECount.
Fixes PR9424.
llvm-svn: 127342
2011-03-09 17:29:58 +00:00
Chris Lattner
2596ac19b9
teach SCEV that the scale and addition of an inbounds gep don't NSW.
...
This fixes a FIXME in scev-aa.ll (allowing a new no-alias result) and
generally makes things more precise.
llvm-svn: 125449
2011-02-13 03:14:49 +00:00
Chris Lattner
fec8b6bd6d
Per discussion with Dan G, inbounds geps *certainly* can have
...
unsigned overflow (e.g. "gep P, -1"), and while they can have
signed wrap in theoretical situations, modelling an AddRec as
not having signed wrap is going enough for any case we can
think of today. In the future if this isn't enough, we can
revisit this. Modeling them as having NUW isn't causing any
known problems either FWIW.
llvm-svn: 125410
2011-02-11 21:43:33 +00:00
Nick Lewycky
13a2b8281f
Simplify some code with no functionality change. Make the test a lot more
...
robust against smarter optimizations, using the power of FileCheck.
llvm-svn: 124081
2011-01-23 20:06:05 +00:00
Nick Lewycky
2503c9f9c8
Use value ranges to fold ext(trunc) in SCEV when possible.
...
llvm-svn: 124062
2011-01-23 06:20:19 +00:00
Tobias Grosser
ea8985cc25
Implement requiredTransitive
...
The PassManager did not implement the transitivity of requiredTransitive. This
was unnoticed since 2006.
llvm-svn: 123942
2011-01-20 21:03:22 +00:00
Nick Lewycky
51c13384f5
Similarly, analyze truncate through multiply.
...
llvm-svn: 123842
2011-01-19 18:56:00 +00:00
Nick Lewycky
9867e58096
Add a missed SCEV fold that is required to continue analyzing the IR produced
...
by indvars through the scev expander.
trunc(add x, y) --> add(trunc x, y). Currently SCEV largely folds the other way
which is probably wrong, but preserved to minimize churn. Instcombine doesn't
do this fold either, demonstrating a missed optz'n opportunity on code doing
add+trunc+add.
llvm-svn: 123838
2011-01-19 16:59:46 +00:00
Nick Lewycky
5a538b62ca
Add a missing SCEV simplification sext(zext x) --> zext x.
...
llvm-svn: 123832
2011-01-19 15:56:12 +00:00
Eric Christopher
c6db56a31e
Revert the testcase from the previous reverted commit.
...
llvm-svn: 123227
2011-01-11 09:20:44 +00:00
Chris Lattner
749f1eff13
add a testcase I missed in previous commit.
...
llvm-svn: 123143
2011-01-09 23:52:31 +00:00
Chris Lattner
57e9b35653
teach SCEV analysis of PHI nodes that PHI recurences formed
...
with GEP instructions are always NUW, because PHIs cannot wrap
the end of the address space.
llvm-svn: 123105
2011-01-09 02:28:48 +00:00
Chris Lattner
fa37cac39c
reduce indentation. Print <nuw> and <nsw> when dumping SCEV AddRec's
...
that have the bit set.
llvm-svn: 123104
2011-01-09 02:16:18 +00:00
Chris Lattner
238f46d92e
remove some noise from tests.
...
llvm-svn: 112889
2010-09-02 22:35:33 +00:00
Dan Gohman
603e66618f
When analyzing loop exit conditions combined with and and or, don't
...
make any assumptions about when the two conditions will agree on when
to permit the loop to exit. This fixes PR7845.
llvm-svn: 110758
2010-08-11 00:12:36 +00:00
Dan Gohman
683a9e2498
Revert the part of r107257 which introduced new logic for using
...
nsw and nuw flags from IR Instructions. On further consideration,
this isn't valid.
llvm-svn: 107298
2010-06-30 17:27:11 +00:00
Dan Gohman
6e7eecf743
Add a testcase for scev-aa's new capability.
...
llvm-svn: 107258
2010-06-30 07:17:47 +00:00
Dan Gohman
a3bc6b13f7
Allow "exhaustive" trip count evaluation on phi nodes with all
...
constant operands.
llvm-svn: 106537
2010-06-22 13:15:46 +00:00
Dan Gohman
cec5b682b6
Fix ScalarEvolution's "exhaustive" trip count evaluation code to avoid
...
assuming that loops are in canonical form, as ScalarEvolution doesn't
depend on LoopSimplify itself. Also, with indirectbr not all loops can
be simplified. This fixes PR7416.
llvm-svn: 106389
2010-06-19 14:17:24 +00:00
Dan Gohman
b5ec637e57
Revert r106304 (105548 and friends), which are the SCEVComplexityCompare
...
optimizations. There is still some nondeterminism remaining.
llvm-svn: 106306
2010-06-18 19:54:20 +00:00
Dan Gohman
527b570925
Reapply 105540, 105542, and 105548, and revert r105732.
...
llvm-svn: 106304
2010-06-18 19:26:04 +00:00
Daniel Dunbar
acd46f61df
Workaround SCEV non-determinism on this test, for now, to get buildbots back to
...
green. Dan, please revert this once the real problem is fixed.
llvm-svn: 105732
2010-06-09 17:54:40 +00:00
Dan Gohman
65954b2eb4
Optimize ScalarEvolution's SCEVComplexityCompare predicate: don't go
...
scrounging through SCEVUnknown contents and SCEVNAryExpr operands;
instead just do a simple deterministic comparison of the precomputed
hash data.
Also, since this is more precise, it eliminates the need for the slow
N^2 duplicate detection code.
llvm-svn: 105540
2010-06-07 19:06:13 +00:00
Dan Gohman
9c1b7fdc46
Add a comment to this test.
...
llvm-svn: 102387
2010-04-26 21:37:43 +00:00
Dan Gohman
231fe284cd
ScalarEvolution support for <= and >= loops.
...
Also, generalize ScalarEvolutions's min and max recognition to handle
some new forms of min and max that this change makes more common.
llvm-svn: 102234
2010-04-24 03:09:42 +00:00
Dan Gohman
31d6b29bae
Don't attempt to analyze values which are obviously undef. This fixes some
...
assertion failures in extreme cases.
llvm-svn: 102042
2010-04-22 01:35:11 +00:00
Dan Gohman
e87da8a25d
Generalize ScalarEvolution's PHI analysis to handle loops that don't
...
have preheaders or dedicated exit blocks, as clients may not otherwise
need to run LoopSimplify.
llvm-svn: 101030
2010-04-12 07:49:36 +00:00
Dan Gohman
a722142044
Avoid analyzing instructions in blocks not reachable from the entry block.
...
They are lots of trouble, and they don't matter. This fixes PR6559.
llvm-svn: 98103
2010-03-09 23:46:50 +00:00
Dan Gohman
9268d67079
Teach ScalarEvolution how to compute a tripcount for a loop with
...
true or false as its exit condition. These are usually eliminated by
SimplifyCFG, but the may be left around during a pass which wishes
to preserve the CFG.
llvm-svn: 96683
2010-02-19 18:12:07 +00:00
Dan Gohman
71fc5e8fce
-disable-output is no longer needed with -analyze.
...
llvm-svn: 94574
2010-01-26 19:25:59 +00:00
Dan Gohman
5e06a05a16
Fix the the ceiling-division used in computing the MaxBECount so that it doesn't
...
have trouble with an intermediate add overflowing. Also, be more conservative
about the case where the induction variable in an SLT loop exit can step past
the RHS of the SLT and overflow in a single step.
Make getSignedRange more aggressive, to recover for some common cases which
the above fixes pessimized.
This addresses rdar://7561161.
llvm-svn: 94512
2010-01-26 04:40:18 +00:00
Dan Gohman
771144e807
Use WriteAsOperand instead of getName() to print loop header names,
...
so that unnamed blocks are handled.
llvm-svn: 93059
2010-01-09 18:17:45 +00:00
Dan Gohman
6bb055cfcd
Add a comment about A[i+(j+1)].
...
llvm-svn: 90185
2009-12-01 01:38:10 +00:00
Chris Lattner
993cb8c911
update status of this. basicaa is much improved now,
...
only missing the one form (in this testcase). Dan, do you
consider this example to be important?
llvm-svn: 89953
2009-11-26 16:42:00 +00:00
Kenneth Uildriks
e711736014
Make opt default to not adding a target data string and update tests that depend on target data to supply it within the test
...
llvm-svn: 85900
2009-11-03 15:29:06 +00:00
Edward O'Callaghan
142c2fc0ae
Convert Analysis tests to FileCheck in regards to PR5307.
...
llvm-svn: 85241
2009-10-27 14:54:46 +00:00