[PATCH] D90402: [LoopFlatten] Run it earlier, just before IndVarSimplify

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 03:57:46 PST 2020


SjoerdMeijer added a comment.

In D90402#2367865 <https://reviews.llvm.org/D90402#2367865>, @dmgreen wrote:

> Quick question on loop flattening preserving analyses. As far as I understand loop passes are required to preserve a number of analyses across all loops. Although I'm not sure if that is new or old pass managers. It's because function level analyses can't easily be rerun inside loop passes.
>
> Would that be true for loop flattening? If we did enable this, would the pass pipeline still look OK?

>From a look at the relevant parts in LoopFlatten, I think it's the NPM that deals with the preserved analysis business:

https://github.com/llvm/llvm-project/blob/b51b424c679f57dd65d83652f3e62ac2cf6de738/llvm/lib/Transforms/Scalar/LoopFlatten.cpp#L550

And what I really hope is that a Loop pass is allowed to modify a loop, and that the pass managers is providing the framework to rerun loop analysis if loop flatten returns `getLoopPassPreservedAnalyses()` and a next pass depends on loop info.

But fair enough, that's a bit of speculation as I never had to look into this. Since the NPM seems to deal with this, I am further guessing it might be the LPM. However, since this is a minor reshuffle, any problem that we had before, is one we will currently have....and since I haven't seen problems, I am guessing (again) it is alright, but could look into this....


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90402/new/

https://reviews.llvm.org/D90402



More information about the llvm-commits mailing list