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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 26 17:34:24 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Target/PowerPC/PPCCTRLoops.cpp:579
+    if (LI->getLoopFor(*I) != L)
+      continue;
+
----------------
The actual condition you need to check is whether the branch executes exactly once per iteration.

For most code, this check is equivalent, but it's possible to have an irreducible "loop" which is not an LLVM Loop.


Repository:
  rL LLVM

https://reviews.llvm.org/D46162





More information about the llvm-commits mailing list