[llvm] [LoopFusion] Extending SIV to handle separate loops (PR #146383)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 24 11:29:06 PDT 2025


================
@@ -298,42 +298,51 @@ bb23:                                             ; preds = %bb17, %bb
   ret void
 }
 
+; void forward_dep(int *arg) {
+;     for (int i = 0; i < 100; i++) {
+;         int tmp = i - 3;
+;         int val = tmp * (i + 3) % i;
+;         arg[i] = val;
+;     }
+; 
+;     for (int j = 0; j < 100; j++) {
+;         int val = arg[j - 3];
+;         arg[j] = val * 3;
+;     }
+; }
+;
----------------
CongzheUalberta wrote:

This function was not fused previously, and now with your patch it is fused. Can you add some comment here to describe it like why it can be fused now?

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


More information about the llvm-commits mailing list