[llvm] [LoopInterchange] Remove 'S' Scalar Dependencies (PR #119345)

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 00:43:17 PST 2025


================
@@ -18,35 +18,28 @@ define void @innermost_latch_uses_values_in_middle_header() {
 ; CHECK:       [[OUTERMOST_HEADER]]:
 ; CHECK-NEXT:    [[INDVAR_OUTERMOST:%.*]] = phi i32 [ 10, %[[ENTRY]] ], [ [[INDVAR_OUTERMOST_NEXT:%.*]], %[[OUTERMOST_LATCH:.*]] ]
 ; CHECK-NEXT:    [[TOBOOL71_I:%.*]] = icmp eq i32 [[TMP0]], 0
-; CHECK-NEXT:    br i1 [[TOBOOL71_I]], label %[[INNERMOST_HEADER_PREHEADER:.*]], label %[[OUTERMOST_LATCH]]
-; CHECK:       [[MIDDLE_HEADER_PREHEADER:.*]]:
+; CHECK-NEXT:    br i1 [[TOBOOL71_I]], label %[[MIDDLE_HEADER_PREHEADER:.*]], label %[[OUTERMOST_LATCH]]
+; CHECK:       [[MIDDLE_HEADER_PREHEADER]]:
 ; CHECK-NEXT:    br label %[[MIDDLE_HEADER:.*]]
 ; CHECK:       [[MIDDLE_HEADER]]:
 ; CHECK-NEXT:    [[INDVAR_MIDDLE:%.*]] = phi i64 [ [[INDVAR_MIDDLE_NEXT:%.*]], %[[MIDDLE_LATCH:.*]] ], [ 4, %[[MIDDLE_HEADER_PREHEADER]] ]
 ; CHECK-NEXT:    [[INDVAR_MIDDLE_WIDE:%.*]] = zext i32 [[B]] to i64
-; CHECK-NEXT:    br label %[[INNERMOST_BODY:.*]]
-; CHECK:       [[INNERMOST_HEADER_PREHEADER]]:
 ; CHECK-NEXT:    br label %[[INNERMOST_HEADER:.*]]
 ; CHECK:       [[INNERMOST_HEADER]]:
-; CHECK-NEXT:    [[INDVAR_INNERMOST:%.*]] = phi i64 [ [[TMP1:%.*]], %[[INNERMOST_LATCH_SPLIT:.*]] ], [ 4, %[[INNERMOST_HEADER_PREHEADER]] ]
-; CHECK-NEXT:    br label %[[MIDDLE_HEADER_PREHEADER]]
+; CHECK-NEXT:    [[INDVAR_INNERMOST:%.*]] = phi i64 [ [[TMP3:%.*]], %[[INNERMOST_LATCH:.*]] ], [ 4, %[[MIDDLE_HEADER]] ]
+; CHECK-NEXT:    br label %[[INNERMOST_BODY:.*]]
----------------
kasuga-fj wrote:

These loops do not seem to be interchanged. It seems that a Basic Block named `XXX.split` is generated when the loops are interchanged. So it is possible that the same thing is happening in the tests where the string `XXX_SPLIT` is removed.

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


More information about the llvm-commits mailing list