[PATCH] D63885: [LOOPINFO] Introduce the loop guard API.

Kit Barton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 16 06:35:34 PDT 2019


kbarton added a comment.

In D63885#1563245 <https://reviews.llvm.org/D63885#1563245>, @reames wrote:

> I'm not sure an API this general is the most relevant.  I would have expected something more tightly tied to the loop itself instead of the region of code which contains the loop.  Thinking about how transforms might want to use this, I suspect a much tighter definition would be useful.
>
> Consider a transform which figures out a condition C under which loop L is a noop.  Modifying the guard (as defined here) would not be valid, but a guard which controls the preheader directly w/no side effects possible inside the guarded region, but outside the loop would be exactly what was needed.  Not sure what other transforms need off the top of my head, but I think that needs to be explored.


@reames Could you expand a bit more on what you mean by "a guard which controls the preheader directly"? At first I took that to mean the guard should be the immediate dominator of the preheader, but now I'm not sure if that is what you meant.
There have been a lot of changes since this comment to check for side effects, but nothing that addresses the "controls the preheader directly".

I'm also not convinced that checking for side effects at the same time as trying to identify the guard is a good idea. To me they are very separate concepts, and combining them ends up confusing things.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D63885





More information about the llvm-commits mailing list