[PATCH] D94717: [LoopNest] Consider loop nest with inner loop guard using outer loop induction variable to be perfect

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 5 11:12:22 PDT 2021


bmahjour added a comment.

In D94717#2737167 <https://reviews.llvm.org/D94717#2737167>, @Whitney wrote:

>> As you can see for.end is not empty and so this loop's guard won't be detected!
>
> From looking at `skipEmptyBlockUntil`, `End` is **not** require to be empty, so `skipEmptyBlockUntil(for.end.loopexit, for.end)` would return `for.end`.

True, although you can have another bb in between that has code, and then we won't be able to detect the guard. I don't think we would want to limit our ability to detect a guard when there is code in the epilogue. There is also the question of what "code" is considered neutral.  Perhaps we need a way to distinguish between guards that are "dedicated" and those that are not.


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

https://reviews.llvm.org/D94717



More information about the llvm-commits mailing list