[llvm] [LoopFusion] Detecting legal dependencies for fusion using DA info (PR #146383)

Alireza Torabian via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 25 07:40:30 PDT 2025


================
@@ -0,0 +1,187 @@
+; RUN: opt -S -passes=loop-fusion -da-disable-delinearization-checks < %s | FileCheck %s
+
+; The two inner loops have no dependency and are allowed to be fused as in the
+; outer loops, different levels are accessed to.
+
+; C Code
+;
+;;  for (long int i = 0; i < n; i++) {
+;;    for (long int j = 0; j < n; j++) {
+;;      for (long int k = 0; k < n; k++)
+;;        A[i][j][k] = i;
+;;      for (long int k = 0; k < n; k++)
+;;        temp = A[i + 3][j + 2][k + 1];
+;;    }
+;;  }
+
+define void @backward_dep0(i64 %n, ptr %A) nounwind uwtable ssp {
----------------
1997alireza wrote:

Changed to `nonequal_outer_access`.

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


More information about the llvm-commits mailing list