[llvm] [LoopFusion] Extending SIV to handle separate loops (PR #146383)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 24 11:29:05 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 {
+entry:
+ %cmp10 = icmp sgt i64 %n, 0
+ br i1 %cmp10, label %for.cond1.preheader.preheader, label %for.end26
+
+; CHECK-LABEL: backward_dep
+; CHECK-COUNT-1: for.body{{[0-9]+}}:
----------------
CongzheUalberta wrote:
I suggest to not rely on BB names in `CHECK`. You can check `stats`, like how many functions are fused, how many dependence checks are passed, etc.
https://github.com/llvm/llvm-project/pull/146383
More information about the llvm-commits
mailing list