| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
when deciding that the loop has stopped evolving. Fixes miscompile in the gcc
torture testsuite!
llvm-svn: 142843
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enhance SCEV's brute force loop analysis to handle multiple PHI nodes in the
loop header when computing the trip count.
With this, we now constant evaluate:
struct ListNode { const struct ListNode *next; int i; };
static const struct ListNode node1 = {0, 1};
static const struct ListNode node2 = {&node1, 2};
static const struct ListNode node3 = {&node2, 3};
int test() {
int sum = 0;
for (const struct ListNode *n = &node3; n != 0; n = n->next)
sum += n->i;
return sum;
}
llvm-svn: 142790
|
|
|
|
|
|
|
| |
state. Furthermore, they might not have two operands. This fixes the underlying
issue behind the crashes introduced in r142781.
llvm-svn: 142788
|
|
|
|
|
|
|
| |
Assertion `i_nocapture < OperandTraits<PHINode>::operands(this) && "getOperand() out of range!"' failed.
coming out of indvars.
llvm-svn: 142786
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
loop header when computing the trip count.
With this, we now constant evaluate:
struct ListNode { const struct ListNode *next; int i; };
static const struct ListNode node1 = {0, 1};
static const struct ListNode node2 = {&node1, 2};
static const struct ListNode node3 = {&node2, 3};
int test() {
int sum = 0;
for (const struct ListNode *n = &node3; n != 0; n = n->next)
sum += n->i;
return sum;
}
llvm-svn: 142781
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
able to constant fold load instructions where the argument is a constant.
Second, we should be able to watch multiple PHI nodes through the loop; this
patch only supports PHIs in loop headers, more can be done here.
With this patch, we now constant evaluate:
static const int arr[] = {1, 2, 3, 4, 5};
int test() {
int sum = 0;
for (int i = 0; i < 5; ++i) sum += arr[i];
return sum;
}
llvm-svn: 142731
|
|
|
|
|
|
|
|
| |
could be arguments, for example.
No testcase because this is a bug-fix broken out of a larger optimization patch.
llvm-svn: 141951
|
|
|
|
| |
llvm-svn: 141219
|
|
|
|
| |
llvm-svn: 141188
|
|
|
|
| |
llvm-svn: 141168
|
|
|
|
|
|
|
|
| |
I noticed during self-review that my previous checkin disabled some
analysis. Even with the reenabled analysis the test case runs in about
5ms. Without the fix, it will take several minutes at least.
llvm-svn: 141164
|
|
|
|
|
|
|
|
|
|
| |
EvaluateExpression.
Note to compiler writers: never recurse on multiple instruction
operands without memoization.
Fixes rdar://10187945. Was taking 45s, now taking 5ms.
llvm-svn: 141161
|
|
|
|
| |
llvm-svn: 141066
|
|
|
|
|
|
| |
logic by David Meyer revealed this bug.
llvm-svn: 140992
|
|
|
|
| |
llvm-svn: 140980
|
|
|
|
| |
llvm-svn: 140979
|
|
|
|
|
|
|
| |
Handle general Add expressions to avoid leaving around redundant
32-bit IVs.
llvm-svn: 140701
|
|
|
|
|
|
|
|
|
|
| |
such.
I'm doing this now for completeness because I can't think of/remember
any reason that it was left out. I'm not sure it will help anything,
but if we don't do it we need to explain why in comments.
llvm-svn: 139450
|
|
|
|
|
|
| |
handle anything more complex. Fixes PR10383 again!
llvm-svn: 139186
|
|
|
|
| |
llvm-svn: 139139
|
|
|
|
| |
llvm-svn: 139138
|
|
|
|
| |
llvm-svn: 139137
|
|
|
|
|
|
| |
add more showing of my work.
llvm-svn: 139136
|
|
|
|
| |
llvm-svn: 139135
|
|
|
|
| |
llvm-svn: 139134
|
|
|
|
|
|
|
| |
visible given a=b=c=d=1, on iteration #1 (the second iteration). Replace it with
correct math. Fixes PR10383!
llvm-svn: 139133
|
|
|
|
| |
llvm-svn: 139130
|
|
|
|
|
|
| |
HowFarToZero; the case for a canonical loop.
llvm-svn: 139126
|
|
|
|
| |
llvm-svn: 139036
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SCEV unrolling can unroll loops with arbitrary induction variables. It
is a prerequisite for -disable-iv-rewrite performance. It is also
easily handles loops of arbitrary structure including multiple exits
and is generally more robust.
This is under a temporary option to avoid affecting default
behavior for the next couple of weeks. It is needed so that I can
checkin unit tests for updateUnloop.
llvm-svn: 137384
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
recurrence, the initial values low bits can sometimes be ignored.
To take advantage of this, added FoldIVUser to IndVarSimplify to fold
an IV operand into a udiv/lshr if the operator doesn't affect the
result.
-indvars -disable-iv-rewrite now transforms
i = phi i4
i1 = i0 + 1
idx = i1 >> (2 or more)
i4 = i + 4
into
i = phi i4
idx = i0 >> ...
i4 = i + 4
llvm-svn: 137013
|
|
|
|
| |
llvm-svn: 136677
|
|
|
|
|
|
|
| |
exit. Added an interfaces for querying either the loop's exact/max
backedge taken count or a specific loop exit's not-taken count.
llvm-svn: 136100
|
|
|
|
| |
llvm-svn: 135477
|
|
|
|
| |
llvm-svn: 135375
|
|
|
|
| |
llvm-svn: 132416
|
|
|
|
|
|
| |
so that their sign extended forms are congruent when no overflow occurs.
llvm-svn: 132360
|
|
|
|
| |
llvm-svn: 131088
|
|
|
|
| |
llvm-svn: 130316
|
|
|
|
| |
llvm-svn: 130294
|
|
|
|
|
|
|
|
|
| |
incompatible type!"' failed.
Added a type check in ScalarEvolution::computeSCEVAtScope to handle the case in which operands of an
AddRecExpr in the current scope are folded.
llvm-svn: 130271
|
|
|
|
| |
llvm-svn: 130166
|
|
|
|
|
|
| |
Luis Felipe Strano Moraes!
llvm-svn: 129558
|
|
|
|
|
|
|
|
|
| |
SCEV may generate expressions composed of multiple pointers, which can
lead to invalid GEP expansion. Until we can teach SCEV to follow strict
pointer rules, make sure no bad GEPs creep into IR.
Fixes rdar://problem/9038671.
llvm-svn: 127839
|
|
|
|
|
|
|
| |
This function performed acrobatics to prove no-self-wrap, which we now
have for free.
llvm-svn: 127643
|
|
|
|
|
|
| |
This needs review.
llvm-svn: 127638
|
|
|
|
| |
llvm-svn: 127593
|
|
|
|
|
|
| |
no-self-wrap.
llvm-svn: 127591
|
|
|
|
|
|
|
|
|
| |
properties.
Added the self-wrap flag for SCEV::AddRecExpr.
A slew of temporary FIXMEs indicate the intention of the no-self-wrap flag
without changing behavior in this revision.
llvm-svn: 127590
|
|
|
|
|
|
|
|
| |
When ExactBECount is a constant, use it for MaxBECount.
When MaxBECount cannot be computed, replace it with ExactBECount.
Fixes PR9424.
llvm-svn: 127342
|