[PATCH] D100464: [DSE] Remove stores in the same loop iteration
Changpeng Fang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 16 21:59:55 PST 2021
cfang added a comment.
We see a big performance regression caused by this patch due to register pressure increase.
We found that remove stores in the same iteration could increase
the register pressure dramatically. In the following piece of code, group 1 and group 2 stores
are eliminated and the register usage increased from 70 to 171. This is from our
critical application, I am not sure whether this DSE could estimate RP?
// group 1 stores
sw[0][j][i] = r0 * du0;
sw[1][j][i] = r0 * du1;
sw[2][j][i] = r0 * du2;
.....
#pragma unroll 8
for (int m = 0; m < 8; m++) {
const double vs =sv[m][j];
du0 += vs * sq[0][m][i];
du1 += vs * sq[1][m][i];
du2 += vs * sq[2][m][i];
}
// group 2 stores
sw[0][j][i] += r1 * du0;
sw[1][j][i] += r1 * du1;
sw[2][j][i] += r1 * du2;
......
#pragma unroll 8
for (int m = 0; m < 8; m++) {
const double xt = st[m][k];
dx0 += xt * ru[0][m];
dx1 += xt * ru[1][m];
dx2 += xt * ru[2][m];
}
// group 3 stores
sw[0][j][i] += r2 * dx0;
sw[1][j][i] += r2 * dx1;
sw[2][j][i] += r2 * dx2;
Any suggestions are welcome to resolve this issue. Thanks.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100464/new/
https://reviews.llvm.org/D100464
More information about the llvm-commits
mailing list