[llvm] [loop-interchange] Move tests to use remarks (PR #123053)
Sjoerd Meijer via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 15 05:49:55 PST 2025
https://github.com/sjoerdmeijer created https://github.com/llvm/llvm-project/pull/123053
Checking the remark message if interchange did or didn't happen is more straight forward than the full IR for these cases. This comment was also made when I moved some tests away from relying on debug builds in change #116780, and this is a prep step for #119345 that is going to change these test cases.
>From 5b662962fb46fec58780e01399122f1b9739b619 Mon Sep 17 00:00:00 2001
From: Sjoerd Meijer <smeijer at nvidia.com>
Date: Wed, 15 Jan 2025 05:27:42 -0800
Subject: [PATCH] [loop-interchange] Move tests to use remarks
Checking the remark message if interchange did or didn't happen is more
straight forward than the full IR for these cases. This comment was
also made when I moved some tests away from relying on debug builds in
change #116780, and this is a prep step for #119345 that is going to
change these steps.
---
.../LoopInterchange/gh54176-scalar-deps.ll | 112 ++++--------------
...most-latch-uses-values-in-middle-header.ll | 72 ++++-------
.../interchange-flow-dep-outer.ll | 72 ++++-------
.../outer-header-jump-to-inner-latch.ll | 105 ++++------------
...97-lcssa-for-multiple-outer-loop-blocks.ll | 98 +++------------
.../LoopInterchange/vector-gep-operand.ll | 46 ++-----
6 files changed, 117 insertions(+), 388 deletions(-)
diff --git a/llvm/test/Transforms/LoopInterchange/gh54176-scalar-deps.ll b/llvm/test/Transforms/LoopInterchange/gh54176-scalar-deps.ll
index b3383655668980..468319683ecdbc 100644
--- a/llvm/test/Transforms/LoopInterchange/gh54176-scalar-deps.ll
+++ b/llvm/test/Transforms/LoopInterchange/gh54176-scalar-deps.ll
@@ -1,5 +1,5 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt < %s -passes=loop-interchange -S | FileCheck %s
+; RUN: opt < %s -passes=loop-interchange -S -pass-remarks-output=%t
+; RUN: FileCheck -input-file %t %s
@f = dso_local local_unnamed_addr global [4 x [9 x i32]] [[9 x i32] [i32 5, i32 3, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0], [9 x i32] zeroinitializer, [9 x i32] zeroinitializer, [9 x i32] zeroinitializer], align 4
@g = common dso_local local_unnamed_addr global i32 0, align 4
@@ -23,54 +23,18 @@
; return g;
; }
;
+define dso_local i32 @test1(i1 %cond) {
+;
; FIXME: if there's an output dependency inside the loop and Src doesn't
; dominate Dst, we should not interchange. Thus, this currently miscompiles.
;
-define dso_local i32 @test1(i1 %cond) {
-; CHECK-LABEL: define dso_local i32 @test1(
-; CHECK-SAME: i1 [[COND:%.*]]) {
-; CHECK-NEXT: [[FOR_PREHEADER:.*:]]
-; CHECK-NEXT: br label %[[INNERLOOP_PREHEADER:.*]]
-; CHECK: [[OUTERLOOP_PREHEADER:.*]]:
-; CHECK-NEXT: br label %[[OUTERLOOP:.*]]
-; CHECK: [[OUTERLOOP]]:
-; CHECK-NEXT: [[I:%.*]] = phi i64 [ [[INDVARS_IV_NEXT21_I:%.*]], %[[FOR_LATCH:.*]] ], [ 0, %[[OUTERLOOP_PREHEADER]] ]
-; CHECK-NEXT: br label %[[INNERLOOP_SPLIT:.*]]
-; CHECK: [[INNERLOOP_PREHEADER]]:
-; CHECK-NEXT: br label %[[INNERLOOP:.*]]
-; CHECK: [[INNERLOOP]]:
-; CHECK-NEXT: [[J:%.*]] = phi i64 [ [[TMP0:%.*]], %[[IF_END_SPLIT:.*]] ], [ 0, %[[INNERLOOP_PREHEADER]] ]
-; CHECK-NEXT: br label %[[OUTERLOOP_PREHEADER]]
-; CHECK: [[INNERLOOP_SPLIT]]:
-; CHECK-NEXT: [[ARRAYIDX6_I:%.*]] = getelementptr inbounds [4 x [9 x i32]], ptr @f, i64 0, i64 [[J]], i64 [[I]]
-; CHECK-NEXT: [[I1:%.*]] = load i32, ptr [[ARRAYIDX6_I]], align 4
-; CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp eq i32 [[I1]], 0
-; CHECK-NEXT: br i1 [[TOBOOL_I]], label %[[LAND_END:.*]], label %[[LAND_RHS:.*]]
-; CHECK: [[LAND_RHS]]:
-; CHECK-NEXT: store i32 3, ptr @g, align 4
-; CHECK-NEXT: br label %[[LAND_END]]
-; CHECK: [[LAND_END]]:
-; CHECK-NEXT: br i1 [[COND]], label %[[IF_END:.*]], label %[[IF_THEN:.*]]
-; CHECK: [[IF_THEN]]:
-; CHECK-NEXT: [[I2:%.*]] = load i32, ptr @g, align 4
-; CHECK-NEXT: [[INC_I:%.*]] = add i32 [[I2]], 1
-; CHECK-NEXT: store i32 [[INC_I]], ptr @g, align 4
-; CHECK-NEXT: br label %[[IF_END]]
-; CHECK: [[IF_END]]:
-; CHECK-NEXT: [[J_NEXT:%.*]] = add nuw nsw i64 [[J]], 1
-; CHECK-NEXT: [[EXITCOND_I:%.*]] = icmp eq i64 [[J_NEXT]], 3
-; CHECK-NEXT: br label %[[FOR_LATCH]]
-; CHECK: [[IF_END_SPLIT]]:
-; CHECK-NEXT: [[TMP0]] = add nuw nsw i64 [[J]], 1
-; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i64 [[TMP0]], 3
-; CHECK-NEXT: br i1 [[TMP1]], label %[[EXIT:.*]], label %[[INNERLOOP]]
-; CHECK: [[FOR_LATCH]]:
-; CHECK-NEXT: [[INDVARS_IV_NEXT21_I]] = add nsw i64 [[I]], 1
-; CHECK-NEXT: [[CMP_I:%.*]] = icmp slt i64 [[I]], 2
-; CHECK-NEXT: br i1 [[CMP_I]], label %[[OUTERLOOP]], label %[[IF_END_SPLIT]]
-; CHECK: [[EXIT]]:
-; CHECK-NEXT: [[I3:%.*]] = load i32, ptr @g, align 4
-; CHECK-NEXT: ret i32 [[I3]]
+; CHECK: --- !Passed
+; CHECK-NEXT: Pass: loop-interchange
+; CHECK-NEXT: Name: Interchanged
+; CHECK-NEXT: Function: test1
+; CHECK-NEXT: Args:
+; CHECK-NEXT: - String: Loop interchanged with enclosing loop.
+; CHECK-NEXT: ...
;
for.preheader:
br label %outerloop
@@ -133,54 +97,18 @@ exit:
; return g;
; }
;
+define dso_local i32 @test2(i1 %cond) {
+;
; FIXME: if there's an output dependency inside the loop and Src doesn't
; dominate Dst, we should not interchange. Thus, this currently miscompiles.
;
-define dso_local i32 @test2(i1 %cond) {
-; CHECK-LABEL: define dso_local i32 @test2(
-; CHECK-SAME: i1 [[COND:%.*]]) {
-; CHECK-NEXT: [[FOR_PREHEADER:.*:]]
-; CHECK-NEXT: br label %[[INNERLOOP_PREHEADER:.*]]
-; CHECK: [[OUTERLOOP_PREHEADER:.*]]:
-; CHECK-NEXT: br label %[[OUTERLOOP:.*]]
-; CHECK: [[OUTERLOOP]]:
-; CHECK-NEXT: [[I:%.*]] = phi i64 [ [[INDVARS_IV_NEXT21_I:%.*]], %[[FOR_LATCH:.*]] ], [ 0, %[[OUTERLOOP_PREHEADER]] ]
-; CHECK-NEXT: br label %[[INNERLOOP_SPLIT:.*]]
-; CHECK: [[INNERLOOP_PREHEADER]]:
-; CHECK-NEXT: br label %[[INNERLOOP:.*]]
-; CHECK: [[INNERLOOP]]:
-; CHECK-NEXT: [[J:%.*]] = phi i64 [ [[TMP0:%.*]], %[[IF_END_SPLIT:.*]] ], [ 0, %[[INNERLOOP_PREHEADER]] ]
-; CHECK-NEXT: br label %[[OUTERLOOP_PREHEADER]]
-; CHECK: [[INNERLOOP_SPLIT]]:
-; CHECK-NEXT: [[ARRAYIDX6_I:%.*]] = getelementptr inbounds [4 x [9 x i32]], ptr @f, i64 0, i64 [[J]], i64 [[I]]
-; CHECK-NEXT: [[I1:%.*]] = load i32, ptr [[ARRAYIDX6_I]], align 4
-; CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp eq i32 [[I1]], 0
-; CHECK-NEXT: store i32 3, ptr @g, align 4
-; CHECK-NEXT: br i1 [[TOBOOL_I]], label %[[LAND_END:.*]], label %[[LAND_RHS:.*]]
-; CHECK: [[LAND_RHS]]:
-; CHECK-NEXT: br label %[[LAND_END]]
-; CHECK: [[LAND_END]]:
-; CHECK-NEXT: br i1 [[COND]], label %[[IF_END:.*]], label %[[IF_THEN:.*]]
-; CHECK: [[IF_THEN]]:
-; CHECK-NEXT: [[I2:%.*]] = load i32, ptr @g, align 4
-; CHECK-NEXT: [[INC_I:%.*]] = add i32 [[I2]], 1
-; CHECK-NEXT: store i32 [[INC_I]], ptr @g, align 4
-; CHECK-NEXT: br label %[[IF_END]]
-; CHECK: [[IF_END]]:
-; CHECK-NEXT: [[J_NEXT:%.*]] = add nuw nsw i64 [[J]], 1
-; CHECK-NEXT: [[EXITCOND_I:%.*]] = icmp eq i64 [[J_NEXT]], 3
-; CHECK-NEXT: br label %[[FOR_LATCH]]
-; CHECK: [[IF_END_SPLIT]]:
-; CHECK-NEXT: [[TMP0]] = add nuw nsw i64 [[J]], 1
-; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i64 [[TMP0]], 3
-; CHECK-NEXT: br i1 [[TMP1]], label %[[EXIT:.*]], label %[[INNERLOOP]]
-; CHECK: [[FOR_LATCH]]:
-; CHECK-NEXT: [[INDVARS_IV_NEXT21_I]] = add nsw i64 [[I]], 1
-; CHECK-NEXT: [[CMP_I:%.*]] = icmp slt i64 [[I]], 2
-; CHECK-NEXT: br i1 [[CMP_I]], label %[[OUTERLOOP]], label %[[IF_END_SPLIT]]
-; CHECK: [[EXIT]]:
-; CHECK-NEXT: [[I3:%.*]] = load i32, ptr @g, align 4
-; CHECK-NEXT: ret i32 [[I3]]
+; CHECK: --- !Passed
+; CHECK-NEXT: Pass: loop-interchange
+; CHECK-NEXT: Name: Interchanged
+; CHECK-NEXT: Function: test2
+; CHECK-NEXT: Args:
+; CHECK-NEXT: - String: Loop interchanged with enclosing loop.
+; CHECK-NEXT: ...
;
for.preheader:
br label %outerloop
diff --git a/llvm/test/Transforms/LoopInterchange/innermost-latch-uses-values-in-middle-header.ll b/llvm/test/Transforms/LoopInterchange/innermost-latch-uses-values-in-middle-header.ll
index bad84224d445ab..f6ac475941f195 100644
--- a/llvm/test/Transforms/LoopInterchange/innermost-latch-uses-values-in-middle-header.ll
+++ b/llvm/test/Transforms/LoopInterchange/innermost-latch-uses-values-in-middle-header.ll
@@ -1,5 +1,5 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt < %s -passes=loop-interchange -verify-dom-info -verify-loop-info -S 2>&1 | FileCheck %s
+; RUN: opt < %s -passes=loop-interchange -verify-dom-info -verify-loop-info -S -pass-remarks-output=%t 2>&1
+; RUN: FileCheck -input-file %t %s
@a = common global i32 0, align 4
@d = common dso_local local_unnamed_addr global [1 x [6 x i32]] zeroinitializer, align 4
@@ -9,53 +9,29 @@
; values defined in the new innermost loop not available in the exiting block of
; the entire loop nest.
;
-define void @innermost_latch_uses_values_in_middle_header() {
-; CHECK-LABEL: define void @innermost_latch_uses_values_in_middle_header() {
-; CHECK-NEXT: [[ENTRY:.*]]:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @a, align 4
-; CHECK-NEXT: [[B:%.*]] = add i32 80, 1
-; CHECK-NEXT: br label %[[OUTERMOST_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 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: [[INNERMOST_BODY]]:
-; CHECK-NEXT: [[ARRAYIDX9_I:%.*]] = getelementptr inbounds [1 x [6 x i32]], ptr @d, i64 0, i64 [[INDVAR_INNERMOST]], i64 [[INDVAR_MIDDLE]]
-; CHECK-NEXT: store i32 0, ptr [[ARRAYIDX9_I]], align 4
-; CHECK-NEXT: br label %[[INNERMOST_LATCH:.*]]
-; CHECK: [[INNERMOST_LATCH]]:
-; CHECK-NEXT: [[INDVAR_INNERMOST_NEXT:%.*]] = add nsw i64 [[INDVAR_INNERMOST]], 1
-; CHECK-NEXT: [[TOBOOL5_I:%.*]] = icmp eq i64 [[INDVAR_INNERMOST_NEXT]], [[INDVAR_MIDDLE_WIDE]]
-; CHECK-NEXT: br label %[[MIDDLE_LATCH]]
-; CHECK: [[INNERMOST_LATCH_SPLIT]]:
-; CHECK-NEXT: [[INDVAR_MIDDLE_WIDE_LCSSA:%.*]] = phi i64 [ [[INDVAR_MIDDLE_WIDE]], %[[MIDDLE_LATCH]] ]
-; CHECK-NEXT: [[TMP1]] = add nsw i64 [[INDVAR_INNERMOST]], 1
-; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], [[INDVAR_MIDDLE_WIDE_LCSSA]]
-; CHECK-NEXT: br i1 [[TMP2]], label %[[OUTERMOST_LATCH_LOOPEXIT:.*]], label %[[INNERMOST_HEADER]]
-; CHECK: [[MIDDLE_LATCH]]:
-; CHECK-NEXT: [[INDVAR_MIDDLE_NEXT]] = add nsw i64 [[INDVAR_MIDDLE]], -1
-; CHECK-NEXT: [[TOBOOL2_I:%.*]] = icmp eq i64 [[INDVAR_MIDDLE_NEXT]], 0
-; CHECK-NEXT: br i1 [[TOBOOL2_I]], label %[[INNERMOST_LATCH_SPLIT]], label %[[MIDDLE_HEADER]]
-; CHECK: [[OUTERMOST_LATCH_LOOPEXIT]]:
-; CHECK-NEXT: br label %[[OUTERMOST_LATCH]]
-; CHECK: [[OUTERMOST_LATCH]]:
-; CHECK-NEXT: [[INDVAR_OUTERMOST_NEXT]] = add nsw i32 [[INDVAR_OUTERMOST]], -5
-; CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp eq i32 [[INDVAR_OUTERMOST_NEXT]], 0
-; CHECK-NEXT: br i1 [[TOBOOL_I]], label %[[OUTERMOST_EXIT:.*]], label %[[OUTERMOST_HEADER]]
-; CHECK: [[OUTERMOST_EXIT]]:
-; CHECK-NEXT: ret void
+; CHECK: --- !Passed
+; CHECK: Pass: loop-interchange
+; CHECK: Name: Interchanged
+; CHECK: Function: innermost_latch_uses_values_in_middle_header
+; CHECK: Args:
+; CHECK: - String: Loop interchanged with enclosing loop.
+; CHECK: ...
+; CHECK: --- !Missed
+; CHECK: Pass: loop-interchange
+; CHECK: Name: UnsupportedInnerLatchPHI
+; CHECK: Function: innermost_latch_uses_values_in_middle_header
+; CHECK: Args:
+; CHECK: - String: Cannot interchange loops because unsupported PHI nodes found in inner loop latch.
+; CHECK: ...
+; CHECK: --- !Missed
+; CHECK: Pass: loop-interchange
+; CHECK: Name: UnsupportedExitPHI
+; CHECK: Function: innermost_latch_uses_values_in_middle_header
+; CHECK: Args:
+; CHECK: - String: Found unsupported PHI node in loop exit.
+; CHECK: ...
;
+define void @innermost_latch_uses_values_in_middle_header() {
entry:
%0 = load i32, ptr @a, align 4
%b = add i32 80, 1
diff --git a/llvm/test/Transforms/LoopInterchange/interchange-flow-dep-outer.ll b/llvm/test/Transforms/LoopInterchange/interchange-flow-dep-outer.ll
index 6daf61a4ec0075..b11ebf0b946b70 100644
--- a/llvm/test/Transforms/LoopInterchange/interchange-flow-dep-outer.ll
+++ b/llvm/test/Transforms/LoopInterchange/interchange-flow-dep-outer.ll
@@ -1,5 +1,5 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -verify-dom-info -verify-loop-info -S 2>&1 | FileCheck %s
+; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -verify-dom-info -verify-loop-info -S -pass-remarks-output=%t 2>&1
+; RUN: FileCheck -input-file %t %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@@ -24,53 +24,29 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; So, loops InnerLoopId = 2 and OuterLoopId = 1 should be interchanged,
; but not InnerLoopId = 1 and OuterLoopId = 0.
;
+; CHECK: --- !Passed
+; CHECK-NEXT: Pass: loop-interchange
+; CHECK-NEXT: Name: Interchanged
+; CHECK-NEXT: Function: interchange_09
+; CHECK-NEXT: Args:
+; CHECK-NEXT: - String: Loop interchanged with enclosing loop.
+; CHECK-NEXT: ...
+; CHECK-NEXT: --- !Missed
+; CHECK-NEXT: Pass: loop-interchange
+; CHECK-NEXT: Name: NotTightlyNested
+; CHECK-NEXT: Function: interchange_09
+; CHECK-NEXT: Args:
+; CHECK-NEXT: - String: Cannot interchange loops because they are not tightly nested.
+; CHECK-NEXT: ...
+; CHECK-NEXT: --- !Missed
+; CHECK-NEXT: Pass: loop-interchange
+; CHECK-NEXT: Name: InterchangeNotProfitable
+; CHECK-NEXT: Function: interchange_09
+; CHECK-NEXT: Args:
+; CHECK-NEXT: - String: Interchanging loops is not considered to improve cache locality nor vectorization.
+; CHECK-NEXT: ...
+
define void @interchange_09(i32 %k) {
-; CHECK-LABEL: define void @interchange_09(
-; CHECK-SAME: i32 [[K:%.*]]) {
-; CHECK-NEXT: [[ENTRY:.*]]:
-; CHECK-NEXT: br label %[[FOR_BODY:.*]]
-; CHECK: [[FOR_COND_CLEANUP:.*]]:
-; CHECK-NEXT: ret void
-; CHECK: [[FOR_BODY]]:
-; CHECK-NEXT: [[INDVARS_IV45:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[INDVARS_IV_NEXT46:%.*]], %[[FOR_COND_CLEANUP4:.*]] ]
-; CHECK-NEXT: [[CALL:%.*]] = call double @fn1()
-; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x double], ptr @T, i64 0, i64 [[INDVARS_IV45]]
-; CHECK-NEXT: store double [[CALL]], ptr [[ARRAYIDX]], align 8
-; CHECK-NEXT: br label %[[FOR_BODY9_PREHEADER:.*]]
-; CHECK: [[FOR_COND6_PREHEADER_PREHEADER:.*]]:
-; CHECK-NEXT: br label %[[FOR_COND6_PREHEADER:.*]]
-; CHECK: [[FOR_COND6_PREHEADER]]:
-; CHECK-NEXT: [[INDVARS_IV42:%.*]] = phi i64 [ [[INDVARS_IV_NEXT43:%.*]], %[[FOR_COND_CLEANUP8:.*]] ], [ 0, %[[FOR_COND6_PREHEADER_PREHEADER]] ]
-; CHECK-NEXT: br label %[[FOR_BODY9_SPLIT1:.*]]
-; CHECK: [[FOR_BODY9_PREHEADER]]:
-; CHECK-NEXT: br label %[[FOR_BODY9:.*]]
-; CHECK: [[FOR_COND_CLEANUP4]]:
-; CHECK-NEXT: [[TMP:%.*]] = load double, ptr [[ARRAYIDX]], align 8
-; CHECK-NEXT: call void @fn2(double [[TMP]])
-; CHECK-NEXT: [[INDVARS_IV_NEXT46]] = add nuw nsw i64 [[INDVARS_IV45]], 1
-; CHECK-NEXT: [[EXITCOND47:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT46]], 100
-; CHECK-NEXT: br i1 [[EXITCOND47]], label %[[FOR_BODY]], label %[[FOR_COND_CLEANUP]]
-; CHECK: [[FOR_COND_CLEANUP8]]:
-; CHECK-NEXT: [[INDVARS_IV_NEXT43]] = add nuw nsw i64 [[INDVARS_IV42]], 1
-; CHECK-NEXT: [[EXITCOND44:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT43]], 1000
-; CHECK-NEXT: br i1 [[EXITCOND44]], label %[[FOR_COND6_PREHEADER]], label %[[FOR_BODY9_SPLIT:.*]]
-; CHECK: [[FOR_BODY9]]:
-; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[TMP0:%.*]], %[[FOR_BODY9_SPLIT]] ], [ 1, %[[FOR_BODY9_PREHEADER]] ]
-; CHECK-NEXT: br label %[[FOR_COND6_PREHEADER_PREHEADER]]
-; CHECK: [[FOR_BODY9_SPLIT1]]:
-; CHECK-NEXT: [[ARRAYIDX13:%.*]] = getelementptr inbounds [1000 x [1000 x i32]], ptr @Arr, i64 0, i64 [[INDVARS_IV]], i64 [[INDVARS_IV42]]
-; CHECK-NEXT: [[T1:%.*]] = load i32, ptr [[ARRAYIDX13]], align 4
-; CHECK-NEXT: [[T2:%.*]] = trunc i64 [[INDVARS_IV45]] to i32
-; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[T1]], [[T2]]
-; CHECK-NEXT: store i32 [[ADD]], ptr [[ARRAYIDX13]], align 4
-; CHECK-NEXT: [[INDVARS_IV_NEXT:%.*]] = add nuw nsw i64 [[INDVARS_IV]], 1
-; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT]], 1000
-; CHECK-NEXT: br label %[[FOR_COND_CLEANUP8]]
-; CHECK: [[FOR_BODY9_SPLIT]]:
-; CHECK-NEXT: [[TMP0]] = add nuw nsw i64 [[INDVARS_IV]], 1
-; CHECK-NEXT: [[TMP1:%.*]] = icmp ne i64 [[TMP0]], 1000
-; CHECK-NEXT: br i1 [[TMP1]], label %[[FOR_BODY9]], label %[[FOR_COND_CLEANUP4]]
-;
entry:
br label %for.body
diff --git a/llvm/test/Transforms/LoopInterchange/outer-header-jump-to-inner-latch.ll b/llvm/test/Transforms/LoopInterchange/outer-header-jump-to-inner-latch.ll
index 6db95c09b175f9..1c8b9c9a768fb7 100644
--- a/llvm/test/Transforms/LoopInterchange/outer-header-jump-to-inner-latch.ll
+++ b/llvm/test/Transforms/LoopInterchange/outer-header-jump-to-inner-latch.ll
@@ -1,4 +1,5 @@
-; RUN: opt -passes=loop-interchange -cache-line-size=64 -verify-dom-info -verify-loop-info -verify-loop-lcssa -S %s | FileCheck %s
+; RUN: opt -passes=loop-interchange -cache-line-size=64 -verify-dom-info -verify-loop-info -verify-loop-lcssa -S %s -pass-remarks-output=%t
+; RUN: FileCheck -input-file %t %s
@b = global [3 x [5 x [8 x i16]]] [[5 x [8 x i16]] zeroinitializer, [5 x [8 x i16]] [[8 x i16] zeroinitializer, [8 x i16] [i16 0, i16 0, i16 0, i16 6, i16 1, i16 6, i16 0, i16 0], [8 x i16] zeroinitializer, [8 x i16] zeroinitializer, [8 x i16] zeroinitializer], [5 x [8 x i16]] zeroinitializer], align 2
@a = common global i32 0, align 4
@@ -19,47 +20,16 @@
;; a |= b[d][d][c + 5];
;; }
;; }
-
+;
+; CHECK: --- !Passed
+; CHECK-NEXT: Pass: loop-interchange
+; CHECK-NEXT: Name: Interchanged
+; CHECK-NEXT: Function: test1
+; CHECK-NEXT: Args:
+; CHECK-NEXT: - String: Loop interchanged with enclosing loop.
+; CHECK-NEXT: ...
+;
define void @test1() {
-;CHECK-LABEL: @test1(
-;CHECK: entry:
-;CHECK-NEXT: br label [[FOR_COND1_PREHEADER:%.*]]
-;CHECK: for.body.preheader:
-;CHECK-NEXT: br label [[FOR_BODY:%.*]]
-;CHECK: for.body:
-;CHECK-NEXT: [[INDVARS_IV22:%.*]] = phi i64 [ [[INDVARS_IV_NEXT23:%.*]], [[FOR_INC8:%.*]] ], [ 0, [[FOR_BODY_PREHEADER:%.*]] ]
-;CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i64 [[INDVARS_IV22:%.*]], 0
-;CHECK-NEXT: br i1 [[TOBOOL]], label [[FOR_BODY3_SPLIT1:%.*]], label [[FOR_BODY3_SPLIT:%.*]]
-;CHECK: for.cond1.preheader:
-;CHECK-NEXT: br label [[FOR_BODY3:%.*]]
-;CHECK: for.body3:
-;CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, [[FOR_COND1_PREHEADER]] ], [ %3, [[FOR_BODY3_SPLIT]] ]
-;CHECK-NEXT: br label [[FOR_BODY_PREHEADER]]
-;CHECK: for.body3.split1:
-;CHECK-NEXT: [[TMP0:%.*]] = add nuw nsw i64 [[INDVARS_IV22]], 5
-;CHECK-NEXT: [[ARRAYIDX7:%.*]] = getelementptr inbounds [3 x [5 x [8 x i16]]], ptr @b, i64 0, i64 [[INDVARS_IV]], i64 [[INDVARS_IV]], i64 [[TMP0]]
-;CHECK-NEXT: [[TMP1:%.*]] = load i16, ptr [[ARRAYIDX7]]
-;CHECK-NEXT: [[CONV:%.*]] = sext i16 [[TMP1]] to i32
-;CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr @a
-;CHECK-NEXT: [[TMP_OR:%.*]] = or i32 [[TMP2]], [[CONV]]
-;CHECK-NEXT: store i32 [[TMP_OR]], ptr @a
-;CHECK-NEXT: [[INDVARS_IV_NEXT:%.*]] = add nuw nsw i64 [[INDVARS_IV]], 1
-;CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT]], 3
-;CHECK-NEXT: br label [[FOR_INC8_LOOPEXIT:%.*]]
-;CHECK: for.body3.split:
-;CHECK-NEXT: [[TMP3:%.*]] = add nuw nsw i64 [[INDVARS_IV]], 1
-;CHECK-NEXT: [[TMP4:%.*]] = icmp ne i64 [[TMP3]], 3
-;CHECK-NEXT: br i1 %4, label [[FOR_BODY3]], label [[FOR_END10:%.*]]
-;CHECK: for.inc8.loopexit:
-;CHECK-NEXT: br label [[FOR_INC8]]
-;CHECK: for.inc8:
-;CHECK-NEXT: [[INDVARS_IV_NEXT23]] = add nuw nsw i64 [[INDVARS_IV22]], 1
-;CHECK-NEXT: [[EXITCOND25:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT23]], 3
-;CHECK-NEXT: br i1 [[EXITCOND25]], label [[FOR_BODY]], label [[FOR_BODY3_SPLIT]]
-;CHECK: for.end10:
-;CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr @a
-;CHECK-NEXT: ret void
-
entry:
br label %for.body
@@ -100,6 +70,7 @@ for.end10: ; preds = %for.inc8
; Triply nested loop
; The innermost and the middle loop are interchanged.
; C test case:
+;
;; a;
;; d[][6];
;; void test2() {
@@ -116,50 +87,16 @@ for.end10: ; preds = %for.inc8
;; }
;; }
;; }
-
-define void @test2() {
-; CHECK-LABEL: @test2(
-; CHECK-NEXT: entry:
-; CHECK-NEXT: br label [[OUTERMOST_HEADER:%.*]]
-; CHECK: outermost.header:
-; CHECK-NEXT: [[INDVAR_OUTERMOST:%.*]] = phi i32 [ 10, [[ENTRY:%.*]] ], [ [[INDVAR_OUTERMOST_NEXT:%.*]], [[OUTERMOST_LATCH:%.*]] ]
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr @a, align 4
-; CHECK-NEXT: [[TOBOOL71_I:%.*]] = icmp eq i32 [[TMP0]], 0
-; CHECK-NEXT: br label [[INNERMOST_PREHEADER:%.*]]
-; 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: br i1 [[TOBOOL71_I]], label [[INNERMOST_BODY_SPLIT1:%.*]], label [[INNERMOST_BODY_SPLIT:%.*]]
-; CHECK: innermost.preheader:
-; CHECK-NEXT: br label [[INNERMOST_BODY:%.*]]
-; CHECK: innermost.body:
-; CHECK-NEXT: [[INDVAR_INNERMOST:%.*]] = phi i64 [ [[TMP1:%.*]], [[INNERMOST_BODY_SPLIT]] ], [ 4, [[INNERMOST_PREHEADER]] ]
-; CHECK-NEXT: br label [[MIDDLE_HEADER_PREHEADER]]
-; CHECK: innermost.body.split1:
-; CHECK-NEXT: [[ARRAYIDX9_I:%.*]] = getelementptr inbounds [1 x [6 x i32]], ptr @d, i64 0, i64 [[INDVAR_INNERMOST]], i64 [[INDVAR_MIDDLE]]
-; CHECK-NEXT: store i32 0, ptr [[ARRAYIDX9_I]], align 4
-; CHECK-NEXT: [[INDVAR_INNERMOST_NEXT:%.*]] = add nsw i64 [[INDVAR_INNERMOST]], -1
-; CHECK-NEXT: [[TOBOOL5_I:%.*]] = icmp eq i64 [[INDVAR_INNERMOST_NEXT]], 0
-; CHECK-NEXT: br label [[MIDDLE_LATCH_LOOPEXIT:%.*]]
-; CHECK: innermost.body.split:
-; CHECK-NEXT: [[TMP1]] = add nsw i64 [[INDVAR_INNERMOST]], -1
-; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 0
-; CHECK-NEXT: br i1 [[TMP2]], label [[OUTERMOST_LATCH]], label [[INNERMOST_BODY]]
-; CHECK: innermost.loopexit:
-; CHECK-NEXT: br label [[MIDDLE_LATCH]]
-; CHECK: middle.latch:
-; CHECK-NEXT: [[INDVAR_MIDDLE_NEXT]] = add nsw i64 [[INDVAR_MIDDLE]], -1
-; CHECK-NEXT: [[TOBOOL2_I:%.*]] = icmp eq i64 [[INDVAR_MIDDLE_NEXT]], 0
-; CHECK-NEXT: br i1 [[TOBOOL2_I]], label [[INNERMOST_BODY_SPLIT]], label [[MIDDLE_HEADER]]
-; CHECK: outermost.latch:
-; CHECK-NEXT: [[INDVAR_OUTERMOST_NEXT]] = add nsw i32 [[INDVAR_OUTERMOST]], -5
-; CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp eq i32 [[INDVAR_OUTERMOST_NEXT]], 0
-; CHECK-NEXT: br i1 [[TOBOOL_I]], label [[OUTERMOST_EXIT:%.*]], label [[OUTERMOST_HEADER]]
-; CHECK: outermost.exit:
-; CHECK-NEXT: ret void
;
-
+; CHECK: --- !Passed
+; CHECK-NEXT: Pass: loop-interchange
+; CHECK-NEXT: Name: Interchanged
+; CHECK-NEXT: Function: test2
+; CHECK-NEXT: Args:
+; CHECK-NEXT: - String: Loop interchanged with enclosing loop.
+; CHECK-NEXT: ...
+;
+define void @test2() {
entry:
br label %outermost.header
diff --git a/llvm/test/Transforms/LoopInterchange/pr43797-lcssa-for-multiple-outer-loop-blocks.ll b/llvm/test/Transforms/LoopInterchange/pr43797-lcssa-for-multiple-outer-loop-blocks.ll
index a0d0543075ffc3..ddcc09bf10b20a 100644
--- a/llvm/test/Transforms/LoopInterchange/pr43797-lcssa-for-multiple-outer-loop-blocks.ll
+++ b/llvm/test/Transforms/LoopInterchange/pr43797-lcssa-for-multiple-outer-loop-blocks.ll
@@ -1,48 +1,19 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -passes=loop-interchange -cache-line-size=64 -verify-loop-lcssa -S %s | FileCheck %s
+; RUN: opt -passes=loop-interchange -cache-line-size=64 -verify-loop-lcssa -S %s -pass-remarks-output=%t
+; RUN: FileCheck -input-file %t %s
; Tests for PR43797.
@wdtdr = external dso_local global [5 x [5 x double]], align 16
+; CHECK: --- !Passed
+; CHECK-NEXT: Pass: loop-interchange
+; CHECK-NEXT: Name: Interchanged
+; CHECK-NEXT: Function: test1
+; CHECK-NEXT: Args:
+; CHECK-NEXT: - String: Loop interchanged with enclosing loop.
+; CHECK-NEXT: ...
+
define void @test1() {
-; CHECK-LABEL: @test1(
-; CHECK-NEXT: entry:
-; CHECK-NEXT: br label [[INNER_HEADER_PREHEADER:%.*]]
-; CHECK: outer.header.preheader:
-; CHECK-NEXT: br label [[OUTER_HEADER:%.*]]
-; CHECK: outer.header:
-; CHECK-NEXT: [[OUTER_IDX:%.*]] = phi i64 [ [[OUTER_IDX_INC:%.*]], [[OUTER_LATCH:%.*]] ], [ 0, [[OUTER_HEADER_PREHEADER:%.*]] ]
-; CHECK-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds [5 x [5 x double]], ptr @wdtdr, i64 0, i64 0, i64 [[OUTER_IDX]]
-; CHECK-NEXT: br label [[INNER_HEADER_SPLIT:%.*]]
-; CHECK: inner.header.preheader:
-; CHECK-NEXT: br label [[INNER_HEADER:%.*]]
-; CHECK: inner.header:
-; CHECK-NEXT: [[INNER_IDX:%.*]] = phi i64 [ [[TMP3:%.*]], [[INNER_LATCH_SPLIT:%.*]] ], [ 0, [[INNER_HEADER_PREHEADER]] ]
-; CHECK-NEXT: br label [[OUTER_HEADER_PREHEADER]]
-; CHECK: inner.header.split:
-; CHECK-NEXT: [[TMP0:%.*]] = load double, ptr [[ARRAYIDX8]], align 8
-; CHECK-NEXT: store double undef, ptr [[ARRAYIDX8]], align 8
-; CHECK-NEXT: br label [[INNER_LATCH:%.*]]
-; CHECK: inner.latch:
-; CHECK-NEXT: [[INNER_IDX_INC:%.*]] = add nsw i64 [[INNER_IDX]], 1
-; CHECK-NEXT: br label [[INNER_EXIT:%.*]]
-; CHECK: inner.latch.split:
-; CHECK-NEXT: [[TMP1:%.*]] = phi i64 [ [[OUTER_V:%.*]], [[OUTER_LATCH]] ]
-; CHECK-NEXT: [[TMP2:%.*]] = phi i64 [ [[OUTER_IDX_INC]], [[OUTER_LATCH]] ]
-; CHECK-NEXT: [[TMP3]] = add nsw i64 [[INNER_IDX]], 1
-; CHECK-NEXT: br i1 false, label [[INNER_HEADER]], label [[OUTER_EXIT:%.*]]
-; CHECK: inner.exit:
-; CHECK-NEXT: [[OUTER_V]] = add nsw i64 [[OUTER_IDX]], 1
-; CHECK-NEXT: br label [[OUTER_LATCH]]
-; CHECK: outer.latch:
-; CHECK-NEXT: [[OUTER_IDX_INC]] = add nsw i64 [[OUTER_IDX]], 1
-; CHECK-NEXT: br i1 false, label [[OUTER_HEADER]], label [[INNER_LATCH_SPLIT]]
-; CHECK: outer.exit:
-; CHECK-NEXT: [[EXIT1_LCSSA:%.*]] = phi i64 [ [[TMP1]], [[INNER_LATCH_SPLIT]] ]
-; CHECK-NEXT: [[EXIT2_LCSSA:%.*]] = phi i64 [ [[TMP2]], [[INNER_LATCH_SPLIT]] ]
-; CHECK-NEXT: ret void
-;
entry:
br label %outer.header
@@ -75,48 +46,15 @@ outer.exit: ; preds = %for.inc27
ret void
}
+; CHECK: --- !Passed
+; CHECK-NEXT: Pass: loop-interchange
+; CHECK-NEXT: Name: Interchanged
+; CHECK-NEXT: Function: test2
+; CHECK-NEXT: Args:
+; CHECK-NEXT: - String: Loop interchanged with enclosing loop.
+; CHECK-NEXT: ...
+
define void @test2(i1 %cond) {
-; CHECK-LABEL: @test2(
-; CHECK-NEXT: entry:
-; CHECK-NEXT: br i1 [[COND:%.*]], label [[INNER_HEADER_PREHEADER:%.*]], label [[OUTER_EXIT:%.*]]
-; CHECK: outer.header.preheader:
-; CHECK-NEXT: br label [[OUTER_HEADER:%.*]]
-; CHECK: outer.header:
-; CHECK-NEXT: [[OUTER_IDX:%.*]] = phi i64 [ [[OUTER_IDX_INC:%.*]], [[OUTER_LATCH:%.*]] ], [ 0, [[OUTER_HEADER_PREHEADER:%.*]] ]
-; CHECK-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds [5 x [5 x double]], ptr @wdtdr, i64 0, i64 0, i64 [[OUTER_IDX]]
-; CHECK-NEXT: br label [[INNER_HEADER_SPLIT:%.*]]
-; CHECK: inner.header.preheader:
-; CHECK-NEXT: br label [[INNER_HEADER:%.*]]
-; CHECK: inner.header:
-; CHECK-NEXT: [[INNER_IDX:%.*]] = phi i64 [ [[TMP3:%.*]], [[INNER_LATCH_SPLIT:%.*]] ], [ 0, [[INNER_HEADER_PREHEADER]] ]
-; CHECK-NEXT: br label [[OUTER_HEADER_PREHEADER]]
-; CHECK: inner.header.split:
-; CHECK-NEXT: [[TMP0:%.*]] = load double, ptr [[ARRAYIDX8]], align 8
-; CHECK-NEXT: store double undef, ptr [[ARRAYIDX8]], align 8
-; CHECK-NEXT: br label [[INNER_LATCH:%.*]]
-; CHECK: inner.latch:
-; CHECK-NEXT: [[INNER_IDX_INC:%.*]] = add nsw i64 [[INNER_IDX]], 1
-; CHECK-NEXT: br label [[INNER_EXIT:%.*]]
-; CHECK: inner.latch.split:
-; CHECK-NEXT: [[TMP1:%.*]] = phi i64 [ [[OUTER_IDX_INC]], [[OUTER_LATCH]] ]
-; CHECK-NEXT: [[TMP2:%.*]] = phi i64 [ [[OUTER_V:%.*]], [[OUTER_LATCH]] ]
-; CHECK-NEXT: [[TMP3]] = add nsw i64 [[INNER_IDX]], 1
-; CHECK-NEXT: br i1 false, label [[INNER_HEADER]], label [[OUTER_EXIT_LOOPEXIT:%.*]]
-; CHECK: inner.exit:
-; CHECK-NEXT: [[OUTER_V]] = add nsw i64 [[OUTER_IDX]], 1
-; CHECK-NEXT: br label [[OUTER_LATCH]]
-; CHECK: outer.latch:
-; CHECK-NEXT: [[OUTER_IDX_INC]] = add nsw i64 [[OUTER_IDX]], 1
-; CHECK-NEXT: br i1 false, label [[OUTER_HEADER]], label [[INNER_LATCH_SPLIT]]
-; CHECK: outer.exit.loopexit:
-; CHECK-NEXT: [[OUTER_IDX_INC_LCSSA:%.*]] = phi i64 [ [[TMP1]], [[INNER_LATCH_SPLIT]] ]
-; CHECK-NEXT: [[OUTER_V_LCSSA:%.*]] = phi i64 [ [[TMP2]], [[INNER_LATCH_SPLIT]] ]
-; CHECK-NEXT: br label [[OUTER_EXIT]]
-; CHECK: outer.exit:
-; CHECK-NEXT: [[EXIT1_LCSSA:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[OUTER_V_LCSSA]], [[OUTER_EXIT_LOOPEXIT]] ]
-; CHECK-NEXT: [[EXIT2_LCSSA:%.*]] = phi i64 [ 0, [[ENTRY]] ], [ [[OUTER_IDX_INC_LCSSA]], [[OUTER_EXIT_LOOPEXIT]] ]
-; CHECK-NEXT: ret void
-;
entry:
br i1 %cond, label %outer.header, label %outer.exit
diff --git a/llvm/test/Transforms/LoopInterchange/vector-gep-operand.ll b/llvm/test/Transforms/LoopInterchange/vector-gep-operand.ll
index 03e3b4b7408b5c..8a5b2e42a0202b 100644
--- a/llvm/test/Transforms/LoopInterchange/vector-gep-operand.ll
+++ b/llvm/test/Transforms/LoopInterchange/vector-gep-operand.ll
@@ -1,43 +1,17 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -passes=loop-interchange -cache-line-size=64 -loop-interchange-threshold=-10 -S %s | FileCheck %s
+; RUN: opt -passes=loop-interchange -cache-line-size=64 -loop-interchange-threshold=-10 -S %s -pass-remarks-output=%t
+; RUN: FileCheck -input-file %t %s
; The test contains a GEP with an operand that is not SCEV-able. Make sure
; loop-interchange does not crash.
-define void @test(ptr noalias %src, ptr %dst) {
-; CHECK-LABEL: @test(
-; CHECK-NEXT: entry:
-; CHECK-NEXT: br label [[INNER_PREHEADER:%.*]]
-; CHECK: outer.header.preheader:
-; CHECK-NEXT: br label [[OUTER_HEADER:%.*]]
-; CHECK: outer.header:
-; CHECK-NEXT: [[I:%.*]] = phi i32 [ [[I_NEXT:%.*]], [[OUTER_LATCH:%.*]] ], [ 0, [[OUTER_HEADER_PREHEADER:%.*]] ]
-; CHECK-NEXT: br label [[INNER_SPLIT1:%.*]]
-; CHECK: inner.preheader:
-; CHECK-NEXT: br label [[INNER:%.*]]
-; CHECK: inner:
-; CHECK-NEXT: [[J:%.*]] = phi i64 [ [[TMP0:%.*]], [[INNER_SPLIT:%.*]] ], [ 0, [[INNER_PREHEADER]] ]
-; CHECK-NEXT: br label [[OUTER_HEADER_PREHEADER]]
-; CHECK: inner.split1:
-; CHECK-NEXT: [[SRC_GEP:%.*]] = getelementptr inbounds [256 x float], ptr [[SRC:%.*]], <2 x i64> <i64 0, i64 1>, i64 [[J]]
-; CHECK-NEXT: [[SRC_0:%.*]] = extractelement <2 x ptr> [[SRC_GEP]], i32 0
-; CHECK-NEXT: [[LV_0:%.*]] = load float, ptr [[SRC_0]], align 4
-; CHECK-NEXT: [[ADD_0:%.*]] = fadd float [[LV_0]], 1.000000e+00
-; CHECK-NEXT: [[DST_GEP:%.*]] = getelementptr inbounds float, ptr [[DST:%.*]], i64 [[J]]
-; CHECK-NEXT: store float [[ADD_0]], ptr [[DST_GEP]], align 4
-; CHECK-NEXT: [[J_NEXT:%.*]] = add nuw nsw i64 [[J]], 1
-; CHECK-NEXT: [[INNER_EXITCOND:%.*]] = icmp eq i64 [[J_NEXT]], 100
-; CHECK-NEXT: br label [[OUTER_LATCH]]
-; CHECK: inner.split:
-; CHECK-NEXT: [[TMP0]] = add nuw nsw i64 [[J]], 1
-; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i64 [[TMP0]], 100
-; CHECK-NEXT: br i1 [[TMP1]], label [[EXIT:%.*]], label [[INNER]]
-; CHECK: outer.latch:
-; CHECK-NEXT: [[I_NEXT]] = add nuw nsw i32 [[I]], 1
-; CHECK-NEXT: [[OUTER_EXITCOND:%.*]] = icmp eq i32 [[I_NEXT]], 100
-; CHECK-NEXT: br i1 [[OUTER_EXITCOND]], label [[INNER_SPLIT]], label [[OUTER_HEADER]]
-; CHECK: exit:
-; CHECK-NEXT: ret void
;
+; CHECK: --- !Passed
+; CHECK-NEXT: Pass: loop-interchange
+; CHECK-NEXT: Name: Interchanged
+; CHECK-NEXT: Function: test
+; CHECK-NEXT: Args:
+; CHECK-NEXT: - String: Loop interchanged with enclosing loop.
+
+define void @test(ptr noalias %src, ptr %dst) {
entry:
br label %outer.header
More information about the llvm-commits
mailing list