[PATCH] D46162: [PowerPC] Don't transform to CTR loop if the decrement branch instr. would end up in a different loop

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 27 03:46:12 PDT 2018


nemanjai added inline comments.


================
Comment at: lib/Target/PowerPC/PPCCTRLoops.cpp:578
+    // end up messing up the value in the CTR.
+    if (LI->getLoopFor(*I) != L || !DT->dominates(L->getHeader(), *I))
+      continue;
----------------
mkazantsev wrote:
> By definition, loop header dominates all blocks of this loop. So once you've checked that `LI->getLoop(*I)` is `L`, it will automatically give you the second part of the check. I think you can assert that `DT->dominates(L->getHeader(), *I))` if the first part is true.
Ah, OK. That makes sense. So clearly my condition isn't sufficient to address Eli's comment. If either you or Eli can suggest how I might modify this condition to also address irreducible loops completely nested in the outer loop, I would really appreciate it.


Repository:
  rL LLVM

https://reviews.llvm.org/D46162





More information about the llvm-commits mailing list