[all-commits] [llvm/llvm-project] 6a076f: [LoopFlatten] Make the analysis more robust after ...
sjoerdmeijer via All-commits
all-commits at lists.llvm.org
Fri Sep 10 04:37:28 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6a076fa9539ee6eea078368bc5298e381c1c059e
https://github.com/llvm/llvm-project/commit/6a076fa9539ee6eea078368bc5298e381c1c059e
Author: Sjoerd Meijer <sjoerd.meijer at arm.com>
Date: 2021-09-10 (Fri, 10 Sep 2021)
Changed paths:
M llvm/lib/Transforms/Scalar/LoopFlatten.cpp
M llvm/test/Transforms/LoopFlatten/widen-iv.ll
Log Message:
-----------
[LoopFlatten] Make the analysis more robust after IV widening
LoopFlatten wasn't triggering on this motivating case after IV widening:
void foo(int *A, int N, int M) {
for (int i = 0; i < N; ++i)
for (int j = 0; j < M; ++j)
f(A[i*M+j]);
}
The reason was that the old induction phi nodes were getting in the way. These
narrow and dead induction phis are not always trivially dead, and having both
the narrow and wide IVs confused the analysis and caused it to bail. This adds
some extra bookkeeping for these old phis, so we can filter them out when
checks on phi nodes are performed. Other clean up passes will get rid of these
old phis and increment instructions.
As this was one of the motivating examples from the beginning, it was
surprising this wasn't triggering from C/C++ code. It looks like the IR and CFG
is just slightly different.
Differential Revision: https://reviews.llvm.org/D109309
More information about the All-commits
mailing list