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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 13:49:05 PDT 2019


efriedma added a comment.

I agree the change to the API makes sense.



================
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)))
----------------
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").


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