New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong code with "opt -loop-reroll": escaping induction value is not updated properly #34108
Comments
I do not think this is NewGVN related, it also fails if I replace -newgvn with -gvn |
Reproducer before -loop-reroll |
I found a possible problematic code in the loop-reroll pass The reporter's loop is as follows. for (; a < 1; a++)
for (b = 0; b < 8; b++)
c[a][b] = 0; It is unrolled by if (a < 1) {
do {
c[a][0] = 0;
c[a][1] = 0;
...
c[a][7] = 0;
a++;
} while (a < 1);
} The corresponding GEP instrctions are as follows. %arrayidx5 = getelementptr inbounds [1 x [8 x i32]], [1 x [8 x i32]]* @​c, \
i64 0, i64 %idxprom, i64 0
%arrayidx5.1 = getelementptr inbounds [1 x [8 x i32]], [1 x [8 x i32]]* @​c, \
i64 0, i64 %idxprom, i64 1
%arrayidx5.2 = getelementptr inbounds [1 x [8 x i32]], [1 x [8 x i32]]* @​c, \
i64 0, i64 %idxprom, i64 2
... Using the current algorithm of the loop-reroll pass, this loop I think the problem is in the It always uses the last operand of a PHI. In the case above, the |
I'd focus on making sure we reject cases the pass doesn't understand, before trying to look into improved unrolling. |
This still reproduces with |
The LoopReroll pass has been removed by #80972. |
Extended Description
This is tested with rev. 314335.
The text was updated successfully, but these errors were encountered: