[PATCH] D132443: [LSR] Fold terminating condition to other IV when possible

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 09:51:46 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:6844
+
+        OldTermCond->replaceAllUsesWith(
+            PoisonValue::get(OldTermCond->getType()));
----------------
What are the other users of `OldTermCond` and why is it ok to replace them with poison?


================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:6849
+        // Cleanup the old terminating condition that is no longer used
+        // Clear the PHINode and DCE will do the rest...
+        while (ToFold->getNumIncomingValues())
----------------
Is there a DCE after this? Earlier optimizations in this function used DeleteDeadPHIs to recursively clean up.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132443/new/

https://reviews.llvm.org/D132443



More information about the llvm-commits mailing list