[PATCH] D63952: [LoopBase] Strengthen isLoopExiting by requiring that BB must be inside the loop.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 14:29:33 PDT 2019


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp:122
+          BasicBlock *Succ1 = Br->getSuccessor(1);
+          if ((L->contains(Succ0) && L->isLoopExiting(Succ0)) ||
+              (L->contains(Succ1) && L->isLoopExiting(Succ1)))
----------------
efriedma wrote:
> This seems substantially different from the original logic.  Probably it should be `if (!L->contains(Succ0) || L->isLoopExiting(Succ0) || [...]`... which would be effectively the same as the original logic in most cases.  Given a loop in LoopSimplify form, the only case I can think of where it wouldn't be the same is if Succ0 or Succ1 has no successors (ends in a "ret" or "unreachable").
I originally thought the original check was intended to check for actual exiting blocks, but I can change it to check for exiting blocks or blocks outside the loop, if that is the intended behavior.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63952





More information about the llvm-commits mailing list