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

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 11 08:16:51 PDT 2025


================
@@ -809,8 +897,29 @@ bool isLoadOrStore(const Instruction *I) {
 //     e - 5
 //     f - 6
 //     g - 7 = MaxLevels
+// If ConsiderSeparateLoops is true then we also want to consider similar
+// seperate loops. Assume that loop nests at level c and e are similar,
+// meaning that they have the same tripcount and depth. Then we consider
+// them as a separate common level.
+//     a      - 1
+//     b      - 2
+//     <c, e> - 3 = CommonLevels
+//     d      - 4 = SrcLevels
+//     f      - 5
+//     g      - 6 = MaxLevels
+// Initially similar separate levels are included in common levels. After
+// the separate level extraction at the end of the depends api we have
+//     a      - 1
+//     b      - 2 = CommonLevels
+//     <c, e> - 3 : A SeparateLevel
----------------
Meinersbur wrote:

```suggestion
//     <c, e> - 3 = SeparateLevels
```

This introduced 3 different meanings of levels and it is not clear what interpretation at what point it the "correct" one. Better integrate into the text above, where SeparateLevels is zero unless ConsiderSeparateLoops.

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


More information about the llvm-commits mailing list