[PATCH] D44199: [LoopRotate] Attempt to Rotate loops if it can lead to removing phi nodes.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 22 11:57:23 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopRotation.cpp:190
+    if (!isa<PHINode>(Phi.getIncomingValueForBlock(Latch)))
+      continue;
+    return true;
----------------
Is the getIncomingValueForBlock() check necessary?  The previous any_of check should enough to ensure we're always eliminating a PHI node, I think?

If it is necessary, please add a testcase demonstrating why.


https://reviews.llvm.org/D44199





More information about the llvm-commits mailing list