Hal Finkel
a8d205f145
Make ScalarEvolution::isKnownPredicate a little smarter
...
Here we make ScalarEvolution::isKnownPredicate, indirectly, a little smarter.
Given some relational comparison operator OP, and two AddRec SCEVs, {I,+,S} OP
{J,+,T}, we can reduce this to the comparison I OP J when S == T, both AddRecs
are for the same loop, and both are known not to wrap.
As it turns out, because of the way that backedge-guard expressions can be
leveraged when computing known predicates, this allows indvars to simplify the
if-statement comparison in this loop:
void foo (int *a, int *b, int n) {
for (int i = 0; i < n; ++i) {
if (i > n)
a[i] = b[i] + 1;
}
}
which, somewhat surprisingly, we were not previously optimizing away.
llvm-svn: 245400
2015-08-19 01:51:51 +00:00
..
2015-02-27 19:29:02 +00:00
2015-06-17 20:52:32 +00:00
2015-06-17 20:52:32 +00:00
2015-06-17 20:52:32 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-04 18:43:29 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-04 18:43:29 +00:00
2015-01-06 19:02:56 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-03-27 22:04:28 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-08-19 01:51:51 +00:00
2015-02-27 19:29:02 +00:00
2015-06-17 20:52:32 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-05-28 21:49:07 +00:00
2015-05-28 21:49:07 +00:00
2015-02-27 21:17:42 +00:00
2015-06-17 20:52:32 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-04 18:43:29 +00:00
2015-02-27 21:17:42 +00:00
2015-05-28 21:49:07 +00:00
2015-03-04 18:43:29 +00:00
2015-03-02 21:41:07 +00:00
2015-03-04 18:43:29 +00:00
2015-02-27 21:17:42 +00:00
2015-03-02 21:41:07 +00:00
2015-04-14 03:20:32 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-07-27 21:42:49 +00:00
2015-07-09 18:46:12 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-04 18:43:29 +00:00
2015-02-27 21:17:42 +00:00
2015-08-06 20:43:41 +00:00
2015-03-04 18:43:29 +00:00
2015-03-04 18:43:29 +00:00
2015-02-27 21:17:42 +00:00
2015-03-04 18:43:29 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-01-15 01:46:09 +00:00
2015-07-28 03:50:09 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-03-04 18:43:29 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-04 18:43:29 +00:00
2015-02-27 21:17:42 +00:00