[PATCH] D136102: [LoopSimplify] Update loop-metadata ID after loop-simplify splitting out new outer loop

MengXuan Cai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 20 13:21:28 PDT 2022


Narutoworld added a comment.

Hi Mikael
Thanks for the comment.

I used to think the most conservative option is to always keep original metadata. 
However, in this case, the most conservative choice seems to remove all metadata other than its loop ID.

Do you think it is a better design to drop all metadata of a loop which is touched by loop-simplify ?

The only problem I could think right now is pass such as loop-unroll use loop's metadata to determine its unroll count. 
e.x People might write `#pragma` to annotate a loop, if that is the case, we cannot just drop the metadata since the information is critical.

In D136102#3867406 <https://reviews.llvm.org/D136102#3867406>, @uabelho wrote:

> Thanks for the patch!
>
> It surely seems to make the output less weird in that the outer and inner loop doesn't use the same metadata ID anymore.
> However, it still keeps the metadata for the inner loop, and I'm not sure it should?
>
> At least in our original case, the metadata does not make sense anymore for the inner loop.
> There the metadata was information about the known minimum iteration count of the loop, and that info is not valid for the inner loop after the rewrite LoopSimplify does.
> Possibly it's not even valid for the outer loop, I'm not sure.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136102



More information about the llvm-commits mailing list