================
@@ -9740,7 +9782,12 @@ static bool checkOpenMPIterationSpace(
         DoacrossC->setLoopData(CurrentNestedLoopCount, CntValue);
     }
   }
-
+  // Record the loop induction variable for nested loop reuse checking.
+  if (CurrentNestedLoopCount < NestedLoopCount && !HasErrors) {
+    if (const ValueDecl *LCDecl = ISC.getLoopDecl()) {
+      CollapsedLoopInductionVars.insert(LCDecl->getCanonicalDecl());
+    }
----------------
alexey-bataev wrote:

```suggestion
    if (const ValueDecl *LCDecl = ISC.getLoopDecl())
      CollapsedLoopInductionVars.insert(LCDecl->getCanonicalDecl());
```

https://github.com/llvm/llvm-project/pull/203252
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to