[llvm] [LoopIdiom] Use HashRecognize to optimize CRC (PR #143208)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 17 08:15:24 PDT 2025


================
@@ -592,11 +594,13 @@ HashRecognize::recognizeCRC() const {
   // true even if it is only really used in an outer loop's exit block, since
   // the loop is in LCSSA form.
   auto *ComputedValue = cast<SelectInst>(ConditionalRecurrence.Step);
-  if (none_of(ComputedValue->users(), [Exit](User *U) {
-        auto *UI = dyn_cast<Instruction>(U);
-        return UI && UI->getParent() == Exit;
-      }))
+  auto LCSSAIt = find_if(ComputedValue->users(), [Exit](User *U) {
+    auto *UI = dyn_cast<PHINode>(U);
+    return UI && UI->getNumIncomingValues() == 1 && UI->getParent() == Exit;
+  });
----------------
artagnon wrote:

This is now gone.

https://github.com/llvm/llvm-project/pull/143208


More information about the llvm-commits mailing list