[llvm] [DependenceAnalysis] Extending SIV to handle separate loops (PR #128782)

Alireza Torabian via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 24 09:36:53 PDT 2025


================
@@ -837,16 +906,20 @@ void DependenceInfo::establishNestingLevels(const Instruction *Src,
     DstLoop = DstLoop->getParentLoop();
     DstLevel--;
   }
+
+  // find the first common level and count the separate levels leading to it
   while (SrcLoop != DstLoop) {
+    SeparateLevels++;
+    if (!areLoopsSimilar(SrcLoop, DstLoop))
+      SeparateLevels = 0;
+    SrcLevel--;
     SrcLoop = SrcLoop->getParentLoop();
     DstLoop = DstLoop->getParentLoop();
----------------
1997alireza wrote:

Done.

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


More information about the llvm-commits mailing list