[llvm-branch-commits] [llvm] [LoopInterchange] Use UTC as much as possible (NFC) (PR #202096)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Jun 6 17:10:05 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Ryotaro Kasuga (kasuga-fj)

<details>
<summary>Changes</summary>

Historically, the loop-interchange tests have relied heavily on checks via pass remarks. This is because pass remarks are more human-readable than the CHECK directives generated by UTC. However, during recent development, I found some downsides:

- Updating them manually is a bit tedious.
- We need to carefully keep the remarks and the code consistent with each other. In other words, we don't have any way to verify whether the remarks themselves are reasonable.

For these reasons, I now think it makes more sense to rely on UTC as much as possible, and this patch does that.

Disclosure: This patch is assisted-by Claude Code.

---

Patch is 173.40 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/202096.diff


22 Files Affected:

- (modified) llvm/test/Transforms/LoopInterchange/confused-dependence.ll (+25-10) 
- (modified) llvm/test/Transforms/LoopInterchange/currentLimitation.ll (+102-50) 
- (modified) llvm/test/Transforms/LoopInterchange/debuginfo.ll (+54-8) 
- (modified) llvm/test/Transforms/LoopInterchange/force-interchange.ll (+32-10) 
- (modified) llvm/test/Transforms/LoopInterchange/fp-reductions.ll (+364-49) 
- (modified) llvm/test/Transforms/LoopInterchange/guarded-inner-loop.ll (+53-10) 
- (modified) llvm/test/Transforms/LoopInterchange/inner-only-reductions.ll (+79-19) 
- (modified) llvm/test/Transforms/LoopInterchange/interchange-insts-between-indvar.ll (+36-4) 
- (modified) llvm/test/Transforms/LoopInterchange/legality-for-scalar-deps.ll (+188-40) 
- (modified) llvm/test/Transforms/LoopInterchange/loopnest-with-outer-btc0.ll (+42-25) 
- (modified) llvm/test/Transforms/LoopInterchange/multilevel-partial-reduction.ll (+51-12) 
- (modified) llvm/test/Transforms/LoopInterchange/outer-dependency-lte.ll (+42-12) 
- (modified) llvm/test/Transforms/LoopInterchange/outer-only-reductions.ll (+29-11) 
- (modified) llvm/test/Transforms/LoopInterchange/pr43176-move-to-new-latch.ll (+55-17) 
- (modified) llvm/test/Transforms/LoopInterchange/pr43326-ideal-access-pattern.ll (+52-24) 
- (modified) llvm/test/Transforms/LoopInterchange/pr43326.ll (+78-16) 
- (modified) llvm/test/Transforms/LoopInterchange/pr48212.ll (+44-17) 
- (modified) llvm/test/Transforms/LoopInterchange/profitability-redundant-interchange.ll (+45-26) 
- (modified) llvm/test/Transforms/LoopInterchange/profitability-vectorization-heuristic.ll (+148-33) 
- (modified) llvm/test/Transforms/LoopInterchange/profitability-vectorization.ll (+89-20) 
- (modified) llvm/test/Transforms/LoopInterchange/reductions-across-inner-and-outer-loop.ll (+209-117) 
- (modified) llvm/test/Transforms/LoopInterchange/reductions-non-wrapped-operations.ll (+251-37) 


``````````diff
diff --git a/llvm/test/Transforms/LoopInterchange/confused-dependence.ll b/llvm/test/Transforms/LoopInterchange/confused-dependence.ll
index 94080949f0af8..da04aee3c210b 100644
--- a/llvm/test/Transforms/LoopInterchange/confused-dependence.ll
+++ b/llvm/test/Transforms/LoopInterchange/confused-dependence.ll
@@ -1,6 +1,5 @@
-; RUN: opt < %s -passes=loop-interchange -pass-remarks-output=%t \
-; RUN:     -disable-output
-; RUN: FileCheck -input-file %t %s
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt < %s -passes=loop-interchange -S | FileCheck %s
 
 ;; In the following case, p0 and p1 may alias, so the direction vector must be [* *].
 ;;
@@ -10,14 +9,30 @@
 ;;       p0[4 * i + j] = p1[4 * j + i];
 ;; }
 
-; CHECK:      --- !Missed
-; CHECK-NEXT: Pass:            loop-interchange
-; CHECK-NEXT: Name:            Dependence
-; CHECK-NEXT: Function:        may_alias
-; CHECK-NEXT: Args:
-; CHECK-NEXT:   - String:          All loops have dependencies in all directions.
-; CHECK-NEXT: ...
 define void @may_alias(ptr %p0, ptr %p1) {
+; CHECK-LABEL: define void @may_alias(
+; CHECK-SAME: ptr [[P0:%.*]], ptr [[P1:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*]]:
+; CHECK-NEXT:    br label %[[FOR_I_HEADER:.*]]
+; CHECK:       [[FOR_I_HEADER]]:
+; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[I_INC:%.*]], %[[FOR_I_LATCH:.*]] ]
+; CHECK-NEXT:    br label %[[FOR_J:.*]]
+; CHECK:       [[FOR_J]]:
+; CHECK-NEXT:    [[J:%.*]] = phi i32 [ 0, %[[FOR_I_HEADER]] ], [ [[J_INC:%.*]], %[[FOR_J]] ]
+; CHECK-NEXT:    [[IDX_0:%.*]] = getelementptr inbounds [4 x [4 x float]], ptr [[P0]], i32 0, i32 [[J]], i32 [[I]]
+; CHECK-NEXT:    [[IDX_1:%.*]] = getelementptr inbounds [4 x [4 x float]], ptr [[P1]], i32 0, i32 [[I]], i32 [[J]]
+; CHECK-NEXT:    [[TMP0:%.*]] = load float, ptr [[IDX_0]], align 4
+; CHECK-NEXT:    store float [[TMP0]], ptr [[IDX_1]], align 4
+; CHECK-NEXT:    [[J_INC]] = add nuw nsw i32 [[J]], 1
+; CHECK-NEXT:    [[CMP_J:%.*]] = icmp slt i32 [[J_INC]], 4
+; CHECK-NEXT:    br i1 [[CMP_J]], label %[[FOR_J]], label %[[FOR_I_LATCH]]
+; CHECK:       [[FOR_I_LATCH]]:
+; CHECK-NEXT:    [[I_INC]] = add nuw nsw i32 [[I]], 1
+; CHECK-NEXT:    [[CMP_I:%.*]] = icmp slt i32 [[I_INC]], 4
+; CHECK-NEXT:    br i1 [[CMP_I]], label %[[FOR_I_HEADER]], label %[[EXIT:.*]]
+; CHECK:       [[EXIT]]:
+; CHECK-NEXT:    ret void
+;
 entry:
   br label %for.i.header
 
diff --git a/llvm/test/Transforms/LoopInterchange/currentLimitation.ll b/llvm/test/Transforms/LoopInterchange/currentLimitation.ll
index 898627b05eacb..6244b9935817e 100644
--- a/llvm/test/Transforms/LoopInterchange/currentLimitation.ll
+++ b/llvm/test/Transforms/LoopInterchange/currentLimitation.ll
@@ -1,11 +1,9 @@
-; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -pass-remarks-missed='loop-interchange' \
-; RUN:   -pass-remarks-output=%t -verify-loop-info -verify-dom-info -S | FileCheck -check-prefix=IR %s
-; RUN: FileCheck --input-file=%t %s
-
-; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -pass-remarks-missed='loop-interchange' \
-; RUN:   -da-disable-delinearization-checks -pass-remarks-output=%t             \
-; RUN:   -verify-loop-info -verify-dom-info -S | FileCheck -check-prefix=IR %s
-; RUN: FileCheck --check-prefix=DELIN --input-file=%t %s
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -verify-loop-info \
+; RUN:     -verify-dom-info -S | FileCheck %s
+; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 \
+; RUN:     -da-disable-delinearization-checks -verify-loop-info -verify-dom-info -S \
+; RUN:     | FileCheck %s
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 
@@ -22,59 +20,113 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 ;;      for(int j=1;j<N-1;j++)
 ;;        A[j+1][i+1] = A[j+1][i+1] + k;
 
-; CHECK:      Name:            Dependence
-; CHECK-NEXT: Function:        interchange_01
 
 ; Guarded nest: %for.cond1.preheader runs the inner loop only when
 ; %cmp324 = (N-1 > 1). The inner exit (inner IV == N-2) only terminates under
-; that guard, so interchanging it loops forever for N == 2. 
-; DELIN:      Name:            NotTightlyNested
-; DELIN-NEXT: Function:        interchange_01
+; that guard, so interchanging it loops forever for N == 2.
 define void @interchange_01(i32 %k, i32 %N) {
- entry:
-   %sub = add nsw i32 %N, -1
-   %cmp26 = icmp sgt i32 %N, 1
-   br i1 %cmp26, label %for.cond1.preheader.lr.ph, label %for.end17
-
- for.cond1.preheader.lr.ph:
-   %cmp324 = icmp sgt i32 %sub, 1
-   %0 = add i32 %N, -2
-   %1 = sext i32 %sub to i64
-   br label %for.cond1.preheader
-
- for.cond.loopexit:
-   %cmp = icmp slt i64 %indvars.iv.next29, %1
-   br i1 %cmp, label %for.cond1.preheader, label %for.end17
-
- for.cond1.preheader:
-   %indvars.iv28 = phi i64 [ 0, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next29, %for.cond.loopexit ]
-   %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1
-   br i1 %cmp324, label %for.body4, label %for.cond.loopexit
-
- for.body4:
-   %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 1, %for.cond1.preheader ]
-   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
-   %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %indvars.iv.next, i64 %indvars.iv.next29
-   %2 = load i32, ptr %arrayidx7
-   %add8 = add nsw i32 %2, %k
-   store i32 %add8, ptr %arrayidx7
-   %lftr.wideiv = trunc i64 %indvars.iv to i32
-   %exitcond = icmp eq i32 %lftr.wideiv, %0
-   br i1 %exitcond, label %for.cond.loopexit, label %for.body4
-
- for.end17:
-   ret void
+; CHECK-LABEL: define void @interchange_01(
+; CHECK-SAME: i32 [[K:%.*]], i32 [[N:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    [[SUB:%.*]] = add nsw i32 [[N]], -1
+; CHECK-NEXT:    [[CMP26:%.*]] = icmp sgt i32 [[N]], 1
+; CHECK-NEXT:    br i1 [[CMP26]], label %[[FOR_COND1_PREHEADER_LR_PH:.*]], label %[[FOR_END17:.*]]
+; CHECK:       [[FOR_COND1_PREHEADER_LR_PH]]:
+; CHECK-NEXT:    [[CMP324:%.*]] = icmp sgt i32 [[SUB]], 1
+; CHECK-NEXT:    [[TMP0:%.*]] = add i32 [[N]], -2
+; CHECK-NEXT:    [[TMP1:%.*]] = sext i32 [[SUB]] to i64
+; CHECK-NEXT:    br label %[[FOR_COND1_PREHEADER:.*]]
+; CHECK:       [[FOR_COND_LOOPEXIT_LOOPEXIT:.*]]:
+; CHECK-NEXT:    br label %[[FOR_COND_LOOPEXIT:.*]]
+; CHECK:       [[FOR_COND_LOOPEXIT]]:
+; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i64 [[INDVARS_IV_NEXT29:%.*]], [[TMP1]]
+; CHECK-NEXT:    br i1 [[CMP]], label %[[FOR_COND1_PREHEADER]], label %[[FOR_END17_LOOPEXIT:.*]]
+; CHECK:       [[FOR_COND1_PREHEADER]]:
+; CHECK-NEXT:    [[INDVARS_IV28:%.*]] = phi i64 [ 0, %[[FOR_COND1_PREHEADER_LR_PH]] ], [ [[INDVARS_IV_NEXT29]], %[[FOR_COND_LOOPEXIT]] ]
+; CHECK-NEXT:    [[INDVARS_IV_NEXT29]] = add nuw nsw i64 [[INDVARS_IV28]], 1
+; CHECK-NEXT:    br i1 [[CMP324]], label %[[FOR_BODY4_PREHEADER:.*]], label %[[FOR_COND_LOOPEXIT]]
+; CHECK:       [[FOR_BODY4_PREHEADER]]:
+; CHECK-NEXT:    br label %[[FOR_BODY4:.*]]
+; CHECK:       [[FOR_BODY4]]:
+; CHECK-NEXT:    [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], %[[FOR_BODY4]] ], [ 1, %[[FOR_BODY4_PREHEADER]] ]
+; CHECK-NEXT:    [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
+; CHECK-NEXT:    [[ARRAYIDX7:%.*]] = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 [[INDVARS_IV_NEXT]], i64 [[INDVARS_IV_NEXT29]]
+; CHECK-NEXT:    [[TMP2:%.*]] = load i32, ptr [[ARRAYIDX7]], align 4
+; CHECK-NEXT:    [[ADD8:%.*]] = add nsw i32 [[TMP2]], [[K]]
+; CHECK-NEXT:    store i32 [[ADD8]], ptr [[ARRAYIDX7]], align 4
+; CHECK-NEXT:    [[LFTR_WIDEIV:%.*]] = trunc i64 [[INDVARS_IV]] to i32
+; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq i32 [[LFTR_WIDEIV]], [[TMP0]]
+; CHECK-NEXT:    br i1 [[EXITCOND]], label %[[FOR_COND_LOOPEXIT_LOOPEXIT]], label %[[FOR_BODY4]]
+; CHECK:       [[FOR_END17_LOOPEXIT]]:
+; CHECK-NEXT:    br label %[[FOR_END17]]
+; CHECK:       [[FOR_END17]]:
+; CHECK-NEXT:    ret void
+;
+  entry:
+  %sub = add nsw i32 %N, -1
+  %cmp26 = icmp sgt i32 %N, 1
+  br i1 %cmp26, label %for.cond1.preheader.lr.ph, label %for.end17
+
+  for.cond1.preheader.lr.ph:
+  %cmp324 = icmp sgt i32 %sub, 1
+  %0 = add i32 %N, -2
+  %1 = sext i32 %sub to i64
+  br label %for.cond1.preheader
+
+  for.cond.loopexit:
+  %cmp = icmp slt i64 %indvars.iv.next29, %1
+  br i1 %cmp, label %for.cond1.preheader, label %for.end17
+
+  for.cond1.preheader:
+  %indvars.iv28 = phi i64 [ 0, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next29, %for.cond.loopexit ]
+  %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1
+  br i1 %cmp324, label %for.body4, label %for.cond.loopexit
+
+  for.body4:
+  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 1, %for.cond1.preheader ]
+  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+  %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %indvars.iv.next, i64 %indvars.iv.next29
+  %2 = load i32, ptr %arrayidx7
+  %add8 = add nsw i32 %2, %k
+  store i32 %add8, ptr %arrayidx7
+  %lftr.wideiv = trunc i64 %indvars.iv to i32
+  %exitcond = icmp eq i32 %lftr.wideiv, %0
+  br i1 %exitcond, label %for.cond.loopexit, label %for.body4
+
+  for.end17:
+  ret void
 }
 
 ; When currently cannot interchange this loop, because transform currently
 ; expects the latches to be the exiting blocks too.
 
-; IR-LABEL: @interchange_02
-; IR-NOT: split
 ;
-; CHECK:      Name:            ExitingNotLatch
-; CHECK-NEXT: Function:        interchange_02
 define void @interchange_02(i64 %k, i64 %N) {
+; CHECK-LABEL: define void @interchange_02(
+; CHECK-SAME: i64 [[K:%.*]], i64 [[N:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*]]:
+; CHECK-NEXT:    br label %[[FOR1_HEADER:.*]]
+; CHECK:       [[FOR1_HEADER]]:
+; CHECK-NEXT:    [[J23:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[J_NEXT24:%.*]], %[[FOR1_INC10:.*]] ]
+; CHECK-NEXT:    br label %[[FOR2:.*]]
+; CHECK:       [[FOR2]]:
+; CHECK-NEXT:    [[J:%.*]] = phi i64 [ [[J_NEXT:%.*]], %[[LATCH:.*]] ], [ 0, %[[FOR1_HEADER]] ]
+; CHECK-NEXT:    [[ARRAYIDX5:%.*]] = getelementptr inbounds [100 x [100 x i64]], ptr @C, i64 0, i64 [[J]], i64 [[J23]]
+; CHECK-NEXT:    [[LV:%.*]] = load i64, ptr [[ARRAYIDX5]], align 8
+; CHECK-NEXT:    [[ADD:%.*]] = add nsw i64 [[LV]], [[K]]
+; CHECK-NEXT:    store i64 [[ADD]], ptr [[ARRAYIDX5]], align 8
+; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq i64 [[J]], 99
+; CHECK-NEXT:    br i1 [[EXITCOND]], label %[[FOR1_INC10]], label %[[LATCH]]
+; CHECK:       [[LATCH]]:
+; CHECK-NEXT:    [[J_NEXT]] = add nuw nsw i64 [[J]], 1
+; CHECK-NEXT:    br label %[[FOR2]]
+; CHECK:       [[FOR1_INC10]]:
+; CHECK-NEXT:    [[J_NEXT24]] = add nuw nsw i64 [[J23]], 1
+; CHECK-NEXT:    [[EXITCOND26:%.*]] = icmp eq i64 [[J23]], 99
+; CHECK-NEXT:    br i1 [[EXITCOND26]], label %[[FOR_END12:.*]], label %[[FOR1_HEADER]]
+; CHECK:       [[FOR_END12]]:
+; CHECK-NEXT:    ret void
+;
 entry:
   br label %for1.header
 
diff --git a/llvm/test/Transforms/LoopInterchange/debuginfo.ll b/llvm/test/Transforms/LoopInterchange/debuginfo.ll
index 87f4208ad0a1c..5deb52ea18306 100644
--- a/llvm/test/Transforms/LoopInterchange/debuginfo.ll
+++ b/llvm/test/Transforms/LoopInterchange/debuginfo.ll
@@ -1,7 +1,5 @@
-; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -pass-remarks='loop-interchange' -pass-remarks-output=%t -S \
-; RUN:     -verify-dom-info -verify-loop-info | FileCheck %s
-; RUN: FileCheck -check-prefix=REMARK --input-file=%t %s
-
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -S | FileCheck %s
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 
@@ -11,11 +9,44 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 ;;    for(int j=0;j<100;j++)
 ;;      A[j][i] = A[j][i]+k;
 
-; REMARK:      Name:            Interchanged
-; REMARK-NEXT: Function:        interchange_01
-; CHECK: split
-
 define void @interchange_01(i64 %k, i64 %N) !dbg !5 {
+; CHECK-LABEL: define void @interchange_01(
+; CHECK-SAME: i64 [[K:%.*]], i64 [[N:%.*]]) !dbg [[DBG5:![0-9]+]] {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    br label %[[FOR2_PREHEADER:.*]]
+; CHECK:       [[FOR1_HEADER_PREHEADER:.*]]:
+; CHECK-NEXT:    br label %[[FOR1_HEADER:.*]]
+; CHECK:       [[FOR1_HEADER]]:
+; CHECK-NEXT:    [[J23:%.*]] = phi i64 [ [[J_NEXT24:%.*]], %[[FOR1_INC10:.*]] ], [ 0, %[[FOR1_HEADER_PREHEADER]] ]
+; CHECK-NEXT:      #dbg_value(i64 [[J:%.*]], [[META13:![0-9]+]], !DIExpression(), [[META14:![0-9]+]])
+; CHECK-NEXT:    br label %[[FOR2_SPLIT1:.*]]
+; CHECK:       [[FOR2_PREHEADER]]:
+; CHECK-NEXT:    br label %[[FOR2:.*]]
+; CHECK:       [[FOR2]]:
+; CHECK-NEXT:    [[J]] = phi i64 [ [[TMP0:%.*]], %[[FOR2_SPLIT:.*]] ], [ 0, %[[FOR2_PREHEADER]] ]
+; CHECK-NEXT:    br label %[[FOR1_HEADER_PREHEADER]]
+; CHECK:       [[FOR2_SPLIT1]]:
+; CHECK-NEXT:      #dbg_value(i64 [[J]], [[META13]], !DIExpression(), [[META14]])
+; CHECK-NEXT:    [[ARRAYIDX5:%.*]] = getelementptr inbounds [100 x [100 x i64]], ptr @A, i64 0, i64 [[J]], i64 [[J23]]
+; CHECK-NEXT:    [[LV:%.*]] = load i64, ptr [[ARRAYIDX5]], align 8
+; CHECK-NEXT:    [[ADD:%.*]] = add nsw i64 [[LV]], [[K]]
+; CHECK-NEXT:    store i64 [[ADD]], ptr [[ARRAYIDX5]], align 8
+; CHECK-NEXT:    [[J_NEXT:%.*]] = add nuw nsw i64 [[J]], 1
+; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq i64 [[J]], 99
+; CHECK-NEXT:      #dbg_value(i64 [[J]], [[META13]], !DIExpression(), [[META14]])
+; CHECK-NEXT:    br label %[[FOR1_INC10]]
+; CHECK:       [[FOR2_SPLIT]]:
+; CHECK-NEXT:    [[TMP0]] = add nuw nsw i64 [[J]], 1
+; CHECK-NEXT:    [[TMP1:%.*]] = icmp eq i64 [[J]], 99
+; CHECK-NEXT:    br i1 [[TMP1]], label %[[FOR_END12:.*]], label %[[FOR2]]
+; CHECK:       [[FOR1_INC10]]:
+; CHECK-NEXT:    [[J_NEXT24]] = add nuw nsw i64 [[J23]], 1
+; CHECK-NEXT:      #dbg_value(i64 [[J]], [[META13]], !DIExpression(), [[META14]])
+; CHECK-NEXT:    [[EXITCOND26:%.*]] = icmp eq i64 [[J23]], 99
+; CHECK-NEXT:    br i1 [[EXITCOND26]], label %[[FOR2_SPLIT]], label %[[FOR1_HEADER]]
+; CHECK:       [[FOR_END12]]:
+; CHECK-NEXT:    ret void
+;
 entry:
   br label %for1.header
 
@@ -67,3 +98,18 @@ declare void @llvm.dbg.value(metadata, metadata, metadata)
 !12 = !{!13}
 !13 = !DILocalVariable(name: "a", arg: 1, scope: !5, file: !1, line: 1, type: !8)
 !14 = !DILocation(line: 1, column: 27, scope: !5)
+;.
+; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: [[META1:![0-9]+]], producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: [[META2:![0-9]+]])
+; CHECK: [[META1]] = !DIFile(filename: "{{.*}}test.c", directory: {{.*}})
+; CHECK: [[META2]] = !{}
+; CHECK: [[DBG5]] = distinct !DISubprogram(name: "foo", scope: [[META1]], file: [[META1]], line: 1, type: [[META6:![0-9]+]], scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META12:![0-9]+]])
+; CHECK: [[META6]] = !DISubroutineType(types: [[META7:![0-9]+]])
+; CHECK: [[META7]] = !{null, [[META8:![0-9]+]], [[META8]], [[META11:![0-9]+]]}
+; CHECK: [[META8]] = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: [[META9:![0-9]+]])
+; CHECK: [[META9]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[META10:![0-9]+]], size: 32, align: 32)
+; CHECK: [[META10]] = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float)
+; CHECK: [[META11]] = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+; CHECK: [[META12]] = !{[[META13]]}
+; CHECK: [[META13]] = !DILocalVariable(name: "a", arg: 1, scope: [[DBG5]], file: [[META1]], line: 1, type: [[META8]])
+; CHECK: [[META14]] = !DILocation(line: 1, column: 27, scope: [[DBG5]])
+;.
diff --git a/llvm/test/Transforms/LoopInterchange/force-interchange.ll b/llvm/test/Transforms/LoopInterchange/force-interchange.ll
index c33ecdf7d9905..a3ce98a42ed5c 100644
--- a/llvm/test/Transforms/LoopInterchange/force-interchange.ll
+++ b/llvm/test/Transforms/LoopInterchange/force-interchange.ll
@@ -1,23 +1,45 @@
-; RUN: opt < %s -passes=loop-interchange -pass-remarks-output=%t -disable-output -loop-interchange-profitabilities=ignore -S
-; RUN: FileCheck --input-file=%t %s
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt < %s -passes=loop-interchange -loop-interchange-profitabilities=ignore -S | FileCheck %s
 
 ; There should be no reason to interchange this, unless it is forced.
 ;
 ;     for (int i = 0; i<1024; i++)
 ;       for (int j = 0; j<1024; j++)
 ;         A[i][j] = 42;
-;
-; CHECK:      --- !Passed
-; CHECK-NEXT: Pass:            loop-interchange
-; CHECK-NEXT: Name:            Interchanged
-; CHECK-NEXT: Function:        f
-; CHECK-NEXT: Args:
-; CHECK-NEXT:   - String:          Loop interchanged with enclosing loop.
-; CHECK-NEXT: ...
 
 @A = dso_local local_unnamed_addr global [1024 x [1024 x i32]] zeroinitializer, align 4
 
 define dso_local void @f() local_unnamed_addr #0 {
+; CHECK-LABEL: define dso_local void @f() local_unnamed_addr {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    br label %[[INNER_BODY_PREHEADER:.*]]
+; CHECK:       [[OUTER_HEADER_PREHEADER:.*]]:
+; CHECK-NEXT:    br label %[[OUTER_HEADER:.*]]
+; CHECK:       [[OUTER_HEADER]]:
+; CHECK-NEXT:    [[I:%.*]] = phi i64 [ [[I_NEXT:%.*]], %[[INNER_HEADER:.*]] ], [ 0, %[[OUTER_HEADER_PREHEADER]] ]
+; CHECK-NEXT:    br label %[[INNER_BODY_SPLIT1:.*]]
+; CHECK:       [[INNER_BODY_PREHEADER]]:
+; CHECK-NEXT:    br label %[[INNER_BODY:.*]]
+; CHECK:       [[INNER_HEADER]]:
+; CHECK-NEXT:    [[I_NEXT]] = add nuw nsw i64 [[I]], 1
+; CHECK-NEXT:    [[EXITCOND20_NOT:%.*]] = icmp eq i64 [[I_NEXT]], 1024
+; CHECK-NEXT:    br i1 [[EXITCOND20_NOT]], label %[[INNER_BODY_SPLIT:.*]], label %[[OUTER_HEADER]]
+; CHECK:       [[INNER_BODY]]:
+; CHECK-NEXT:    [[J:%.*]] = phi i64 [ [[TMP0:%.*]], %[[INNER_BODY_SPLIT]] ], [ 0, %[[INNER_BODY_PREHEADER]] ]
+; CHECK-NEXT:    br label %[[OUTER_HEADER_PREHEADER]]
+; CHECK:       [[INNER_BODY_SPLIT1]]:
+; CHECK-NEXT:    [[ARRAYIDX6:%.*]] = getelementptr inbounds nuw [1024 x [1024 x i32]], ptr @A, i64 0, i64 [[I]], i64 [[J]]
+; CHECK-NEXT:    store i32 42, ptr [[ARRAYIDX6]], align 4
+; CHECK-NEXT:    [[J_NEXT:%.*]] = add nuw nsw i64 [[J]], 1
+; CHECK-NEXT:    [[EXITCOND_NOT:%.*]] = icmp eq i64 [[J_NEXT]], 1024
+; CHECK-NEXT:    br label %[[INNER_HEADER]]
+; CHECK:       [[INNER_BODY_SPLIT]]:
+; CHECK-NEXT:    [[TMP0]] = add nuw nsw i64 [[J]], 1
+; CHECK-NEXT:    [[TMP1:%.*]] = icmp eq i64 [[TMP0]], 1024
+; CHECK-NEXT:    br i1 [[TMP1]], label %[[EXIT:.*]], label %[[INNER_BODY]]
+; CHECK:       [[EXIT]]:
+; CHECK-NEXT:    ret void
+;
 entry:
   br label %outer.header
 
diff --git a/llvm/test/Transforms/LoopInterchange/fp-reductions.ll b/llvm/test/Transforms/LoopInterchange/fp-reductions.ll
index 0703a7b27979a..ebd48c203139a 100644
--- a/llvm/test/Transforms/LoopInterchange/fp-reductions.ll
+++ b/llvm/test/Transforms/LoopInterchange/fp-reductions.ll
@@ -1,6 +1,5 @@
-; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -pass-remarks-output=%t -disable-output \
-; RUN:     -verify-dom-info -verify-loop-info -verify-loop-lcssa
-; RUN: FileCheck -input-file=%t %s
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -S | FileCheck %s
 
 ; Check that the loops aren't exchanged if there is a reduction of
 ; non-reassociative floating-point addition.
@@ -10,11 +9,32 @@
 ;   for (int j = 0; j < 2; j++)
 ;     sum += A[j][i];
 
-; CHECK:      --- !Missed
-; CHECK-NEXT: Pass:            loop-interchange
-; CHECK-NEXT: Name:            UnsupportedPHIOuter
-; CHECK-NEXT: Function:        reduction_fadd
 define void @reduction_fadd(ptr %A) {
+; CHECK-LABEL: define void @reduction_fadd(
+; CHECK-SAME: ptr [[A:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*]]:
+; CHECK-NEXT:    br label %[[FOR_I_HEADER:.*]]
+; CHECK:       [[FOR_I_HEADER]]:
+; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[I_INC:%.*]], %[[FOR_I_LATCH:.*]] ]
+; CHECK-NEXT:    [[SUM_I:%.*]] = phi float [ 0.000000e+00, %[[ENTRY]] ], [ [[SUM_I_LCSSA:%.*]], %[[FOR_I_LATCH]] ]
+; CHECK-NEXT:    br label %[[FOR_J:.*]]
+; CHECK:       [[FOR_J]]:
+; CHECK-NEXT:    [[J:%.*]] = phi i32 [ 0, %[[FOR_I_HEADER]] ], [ [[J_INC:%.*]], %[[FOR_J]] ]
+; CHECK-NEXT:    [[SUM_J:%.*]] = phi float [ [[SUM_I]], %[[FOR_I_HEADER]] ], [ [[...
[truncated]

``````````

</details>


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


More information about the llvm-branch-commits mailing list