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

Alireza Torabian via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 19 08:12:20 PDT 2025


================
@@ -3951,6 +4080,25 @@ DependenceInfo::depends(Instruction *Src, Instruction *Dst,
 #endif
   }
 
+  if (FusableLevels > 0) {
+    // Extracting fusable levels from the common levels
+    // Reverting CommonLevels and MaxLevels to their original values
+    assert(CommonLevels >= FusableLevels);
+    CommonLevels -= FusableLevels;
+    MaxLevels += FusableLevels;
+    std::unique_ptr<FullDependence::DVEntry[]> DV, DVFusable;
+    DV = std::make_unique<FullDependence::DVEntry[]>(CommonLevels);
+    DVFusable = std::make_unique<FullDependence::DVEntry[]>(FusableLevels);
+    for (unsigned level = 0; level < CommonLevels; ++level)
+      DV[level] = Result.DV[level];
+    for (unsigned level = 0; level < FusableLevels; ++level)
+      DVFusable[level] = Result.DV[CommonLevels + level];
----------------
1997alireza wrote:

Applied.

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


More information about the llvm-commits mailing list