[PATCH] D90940: [LoopFlatten] Make it a FunctionPass
Sjoerd Meijer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 6 07:26:53 PST 2020
SjoerdMeijer added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LoopFlatten.cpp:535
+ bool Changed = false;
+ for (auto *OuterLoop : LI->getTopLevelLoops()) {
+ if (OuterLoop->getSubLoops().size() != 1)
----------------
SjoerdMeijer wrote:
> dmgreen wrote:
> > Should this be handling sub-loops too? Maybe use getLoopsInPreorder if that works how I think it does?
> Ah, I guess so. This will flatten only doubly nested loops, but won't flatten j and k in a 3d loop:
>
> for i
> for j
> for k
>
> Looks like a test is missing too...
But maybe this is not supported anyway, will check.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90940/new/
https://reviews.llvm.org/D90940
More information about the llvm-commits
mailing list