[PATCH] D98263: [LoopInterchange] fix tightlyNested() in LoopInterchange legality

Ta-Wei Tu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 10 18:53:15 PST 2021


TaWeiTu added a comment.

Hi @congzhe, thanks for the fix!

I think it'd probably be better to keep the `LoopNest::checkLoopsStructure` and add the additional checks of branch instructions for now.
By doing so, future changes to `LoopNest` will also apply in `LoopInterchange`, which is what we are trying to achieve I think (by making the definition of perfectly-nested loop in sync).
The check can be removed in the future, when `LoopNest` is eventually taught to correctly identify guard branches (`singleSucc` is currently considered to be the guard branch of the inner loop, but the loops should only be considered perfectly-nested if the guard branch corresponds to the one added by `LoopRotate` IMO, which is not true in this case).

What do you think?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98263



More information about the llvm-commits mailing list