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

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 26 21:35:24 PDT 2018


mkazantsev 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;
----------------
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D46162





More information about the llvm-commits mailing list