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

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 12:06:13 PDT 2019


Meinersbur added a comment.

So far, we have the following guarantees of a loop guard:

1. If branching into the direction of the loop, the loop will be executed
2. If branching to the other direction, the loop will not be executed.
3. If branching to the other direction, no code will be executed that would not be executed if going to the direction of the loop.
4. Loop guard and the post-dominating 'other' block form a Single-Entry-Single-Exit region. [edit: not true; there can be edges from the outside to a loop exit block]

What purpose does checking for unsafe instructions after the loop serve? Do we also need to exclude possible infinite loops after the loop exit(s)? [branches out of the region including unreachable, ret are already ruled out be the postdominator construction].

For 2., if that's the goal, could there be an alternative formulation, such as the loop exit block dominates the "other direction block"?


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