[llvm] [Matrix] Add -debug-only prints when matrices get flattened (PR #142078)
Jon Roelofs via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 9 15:13:58 PDT 2025
https://github.com/jroelofs updated https://github.com/llvm/llvm-project/pull/142078
>From ce446d015f734b7e24309ca1feb3b694c87eb7d4 Mon Sep 17 00:00:00 2001
From: Jon Roelofs <jonathan_roelofs at apple.com>
Date: Thu, 29 May 2025 19:45:04 -0700
Subject: [PATCH 1/6] [Matrix] Add -debug-only prints when matrices get
flattened
This is a potential source of overhead, which we might be able to alleviate in
some cases. For example, static element extracts, or shuffles that pluck out a
specific row. Since these diagnostics are highly specific to the pass itself
and not immediately actionable for compiler users, these prints don't make a
whole lot of sense as Remarks.
---
.../Scalar/LowerMatrixIntrinsics.cpp | 47 +++++++++++++++++--
1 file changed, 43 insertions(+), 4 deletions(-)
diff --git a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
index 5a518244a80ca..143a3006c18f0 100644
--- a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
@@ -40,6 +40,7 @@
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
@@ -221,7 +222,16 @@ struct ShapeInfo {
/// Returns the transposed shape.
ShapeInfo t() const { return ShapeInfo(NumColumns, NumRows); }
+
+ friend raw_ostream &operator<<(raw_ostream &OS, ShapeInfo SI);
+
+ LLVM_DUMP_METHOD void dump() const { dbgs() << *this << '\n'; }
};
+
+raw_ostream &operator<<(raw_ostream &OS, ShapeInfo SI) {
+ return OS << SI.NumRows << 'x' << SI.NumColumns;
+}
+
} // namespace
static bool isUniformShape(Value *V) {
@@ -466,6 +476,8 @@ class LowerMatrixIntrinsics {
return getNumColumns();
}
+ ShapeInfo shape() const { return {getNumRows(), getNumColumns()}; }
+
/// Extract a vector of \p NumElts starting at index (\p I, \p J). If the
/// matrix is column-major, the result vector is extracted from a column
/// vector, otherwise from a row vector.
@@ -578,6 +590,25 @@ class LowerMatrixIntrinsics {
SplitVecs.push_back(V);
}
+ LLVM_DEBUG(if (Instruction *Inst = dyn_cast<Instruction>(MatrixVal)) {
+ if (Found != Inst2ColumnMatrix.end()) {
+ // FIXME: re: "at least": SplitVecs.size() doesn't count the shuffles
+ // that embedInVector created.
+ dbgs() << "matrix reshape from " << Found->second.shape() << " to "
+ << SI << " using at least " << SplitVecs.size()
+ << " shuffles on behalf of " << *Inst << '\n';
+ } else if (!ShapeMap.contains(MatrixVal)) {
+ dbgs() << "splitting a " << SI << " matrix with " << SplitVecs.size()
+ << " shuffles beacuse we do not have a shape-aware lowering for "
+ "its def: "
+ << *Inst << '\n';
+ } else {
+ // The ShapeMap has it, so it's a case where we're being lowered
+ // before the def, and we expect that InstCombine will clean things up
+ // afterward.
+ }
+ });
+
return {SplitVecs};
}
@@ -1386,11 +1417,19 @@ class LowerMatrixIntrinsics {
ToRemove.push_back(Inst);
Value *Flattened = nullptr;
for (Use &U : llvm::make_early_inc_range(Inst->uses())) {
- if (!ShapeMap.contains(U.getUser())) {
- if (!Flattened)
- Flattened = Matrix.embedInVector(Builder);
- U.set(Flattened);
+ if (ShapeMap.contains(U.getUser()))
+ continue;
+
+ if (!Flattened) {
+ Flattened = Matrix.embedInVector(Builder);
+ LLVM_DEBUG(
+ if (Instruction *User = dyn_cast<Instruction>(U.getUser())) dbgs()
+ << "flattening a " << Matrix.shape() << " matrix " << *Inst
+ << " because we do not have a shape-aware lowering for its "
+ "user: "
+ << *User << '\n';);
}
+ U.set(Flattened);
}
}
>From 5cec3705b14ab73da0c84a033c7bb98ee0ce9d0f Mon Sep 17 00:00:00 2001
From: Jon Roelofs <jonathan_roelofs at apple.com>
Date: Mon, 9 Jun 2025 14:41:11 -0700
Subject: [PATCH 2/6] add one test
---
.../LowerMatrixIntrinsics/flatten.ll | 26 +++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 llvm/test/Transforms/LowerMatrixIntrinsics/flatten.ll
diff --git a/llvm/test/Transforms/LowerMatrixIntrinsics/flatten.ll b/llvm/test/Transforms/LowerMatrixIntrinsics/flatten.ll
new file mode 100644
index 0000000000000..0e55360f9a890
--- /dev/null
+++ b/llvm/test/Transforms/LowerMatrixIntrinsics/flatten.ll
@@ -0,0 +1,26 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -passes='lower-matrix-intrinsics' -S < %s | FileCheck %s
+; RUN: opt -passes=lower-matrix-intrinsics -debug-only=lower-matrix-intrinsics -disable-output < %s 2>&1 | FileCheck %s --check-prefix=PASS-DEBUG
+; REQUIRES: asserts
+
+define void @diag_3x3(ptr %in, ptr %out) {
+; CHECK-LABEL: @diag_3x3(
+; CHECK-NEXT: [[COL_LOAD:%.*]] = load <3 x float>, ptr [[IN:%.*]], align 4
+; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr float, ptr [[IN]], i64 3
+; CHECK-NEXT: [[COL_LOAD1:%.*]] = load <3 x float>, ptr [[VEC_GEP]], align 4
+; CHECK-NEXT: [[VEC_GEP2:%.*]] = getelementptr float, ptr [[IN]], i64 6
+; CHECK-NEXT: [[COL_LOAD3:%.*]] = load <3 x float>, ptr [[VEC_GEP2]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <3 x float> [[COL_LOAD]], <3 x float> [[COL_LOAD1]], <6 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5>
+; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <3 x float> [[COL_LOAD3]], <3 x float> poison, <6 x i32> <i32 0, i32 1, i32 2, i32 poison, i32 poison, i32 poison>
+; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <6 x float> [[TMP1]], <6 x float> [[TMP2]], <9 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8>
+; CHECK-NEXT: [[DIAG:%.*]] = shufflevector <9 x float> [[TMP3]], <9 x float> poison, <3 x i32> <i32 0, i32 4, i32 8>
+; CHECK-NEXT: store <3 x float> [[DIAG]], ptr [[OUT:%.*]], align 16
+; CHECK-NEXT: ret void
+;
+ %inv = call <9 x float> @llvm.matrix.column.major.load(ptr %in, i64 3, i1 false, i32 3, i32 3)
+ %diag = shufflevector <9 x float> %inv, <9 x float> poison, <3 x i32> <i32 0, i32 4, i32 8>
+ store <3 x float> %diag, ptr %out
+ ret void
+}
+;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
+; PASS-DEBUG: flattening a 3x3 matrix %{{.*}} = call <9 x float> @llvm.matrix.column.major.load.v9f32.i64(ptr %{{.*}}, i64 3, i1 false, i32 3, i32 3) because we do not have a shape-aware lowering for its user: %{{.*}} = shufflevector <9 x float> %{{.*}}, <9 x float> poison, <3 x i32> <i32 0, i32 4, i32 8>
>From 233c887cdaff6ee457c838df6b9570551f1bdec3 Mon Sep 17 00:00:00 2001
From: Jon Roelofs <jonathan_roelofs at apple.com>
Date: Mon, 9 Jun 2025 14:50:18 -0700
Subject: [PATCH 3/6] add a couple more tests
---
.../Scalar/LowerMatrixIntrinsics.cpp | 10 ++--
.../LowerMatrixIntrinsics/flatten.ll | 59 +++++++++++++------
2 files changed, 46 insertions(+), 23 deletions(-)
diff --git a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
index 143a3006c18f0..7964b9c4932d3 100644
--- a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
@@ -596,11 +596,11 @@ class LowerMatrixIntrinsics {
// that embedInVector created.
dbgs() << "matrix reshape from " << Found->second.shape() << " to "
<< SI << " using at least " << SplitVecs.size()
- << " shuffles on behalf of " << *Inst << '\n';
+ << " shuffles on behalf of:\n" << *Inst << '\n';
} else if (!ShapeMap.contains(MatrixVal)) {
dbgs() << "splitting a " << SI << " matrix with " << SplitVecs.size()
<< " shuffles beacuse we do not have a shape-aware lowering for "
- "its def: "
+ "its def:\n"
<< *Inst << '\n';
} else {
// The ShapeMap has it, so it's a case where we're being lowered
@@ -1424,9 +1424,9 @@ class LowerMatrixIntrinsics {
Flattened = Matrix.embedInVector(Builder);
LLVM_DEBUG(
if (Instruction *User = dyn_cast<Instruction>(U.getUser())) dbgs()
- << "flattening a " << Matrix.shape() << " matrix " << *Inst
- << " because we do not have a shape-aware lowering for its "
- "user: "
+ << "flattening a " << Matrix.shape() << " matrix:\n" << *Inst
+ << "\nbecause we do not have a shape-aware lowering for its "
+ "user:\n"
<< *User << '\n';);
}
U.set(Flattened);
diff --git a/llvm/test/Transforms/LowerMatrixIntrinsics/flatten.ll b/llvm/test/Transforms/LowerMatrixIntrinsics/flatten.ll
index 0e55360f9a890..0013cd5342a18 100644
--- a/llvm/test/Transforms/LowerMatrixIntrinsics/flatten.ll
+++ b/llvm/test/Transforms/LowerMatrixIntrinsics/flatten.ll
@@ -1,26 +1,49 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -passes='lower-matrix-intrinsics' -S < %s | FileCheck %s
-; RUN: opt -passes=lower-matrix-intrinsics -debug-only=lower-matrix-intrinsics -disable-output < %s 2>&1 | FileCheck %s --check-prefix=PASS-DEBUG
+; RUN: opt -passes=lower-matrix-intrinsics -debug-only=lower-matrix-intrinsics -disable-output < %s 2>&1 | FileCheck %s --check-prefix=CHECK
; REQUIRES: asserts
define void @diag_3x3(ptr %in, ptr %out) {
-; CHECK-LABEL: @diag_3x3(
-; CHECK-NEXT: [[COL_LOAD:%.*]] = load <3 x float>, ptr [[IN:%.*]], align 4
-; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr float, ptr [[IN]], i64 3
-; CHECK-NEXT: [[COL_LOAD1:%.*]] = load <3 x float>, ptr [[VEC_GEP]], align 4
-; CHECK-NEXT: [[VEC_GEP2:%.*]] = getelementptr float, ptr [[IN]], i64 6
-; CHECK-NEXT: [[COL_LOAD3:%.*]] = load <3 x float>, ptr [[VEC_GEP2]], align 4
-; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <3 x float> [[COL_LOAD]], <3 x float> [[COL_LOAD1]], <6 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5>
-; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <3 x float> [[COL_LOAD3]], <3 x float> poison, <6 x i32> <i32 0, i32 1, i32 2, i32 poison, i32 poison, i32 poison>
-; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <6 x float> [[TMP1]], <6 x float> [[TMP2]], <9 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8>
-; CHECK-NEXT: [[DIAG:%.*]] = shufflevector <9 x float> [[TMP3]], <9 x float> poison, <3 x i32> <i32 0, i32 4, i32 8>
-; CHECK-NEXT: store <3 x float> [[DIAG]], ptr [[OUT:%.*]], align 16
-; CHECK-NEXT: ret void
-;
%inv = call <9 x float> @llvm.matrix.column.major.load(ptr %in, i64 3, i1 false, i32 3, i32 3)
%diag = shufflevector <9 x float> %inv, <9 x float> poison, <3 x i32> <i32 0, i32 4, i32 8>
store <3 x float> %diag, ptr %out
ret void
}
-;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
-; PASS-DEBUG: flattening a 3x3 matrix %{{.*}} = call <9 x float> @llvm.matrix.column.major.load.v9f32.i64(ptr %{{.*}}, i64 3, i1 false, i32 3, i32 3) because we do not have a shape-aware lowering for its user: %{{.*}} = shufflevector <9 x float> %{{.*}}, <9 x float> poison, <3 x i32> <i32 0, i32 4, i32 8>
+; CHECK-LABEL: flattening a 3x3 matrix:
+; CHECK-NEXT: %{{.*}} = call <9 x float> @llvm.matrix.column.major.load.v9f32.i64(ptr %{{.*}}, i64 3, i1 false, i32 3, i32 3)
+; CHECK-NEXT: because we do not have a shape-aware lowering for its user:
+; CHECK-NEXT: %{{.*}} = shufflevector <9 x float> %{{.*}}, <9 x float> poison, <3 x i32> <i32 0, i32 4, i32 8>
+
+define void @reshape(ptr %in, ptr %out) {
+entry:
+ %0 = load <4 x double>, ptr %in, align 8
+ %1 = tail call <4 x double> @llvm.matrix.transpose.v4f64(<4 x double> %0, i32 4, i32 1)
+ %2 = tail call <4 x double> @llvm.matrix.transpose.v4f64(<4 x double> %1, i32 1, i32 4)
+ %3 = tail call <4 x double> @llvm.matrix.transpose.v4f64(<4 x double> %2, i32 2, i32 2)
+ %4 = tail call <4 x double> @llvm.matrix.transpose.v4f64(<4 x double> %3, i32 2, i32 2)
+ %5 = tail call <4 x double> @llvm.matrix.transpose.v4f64(<4 x double> %4, i32 2, i32 2)
+ store <4 x double> %5, ptr %out, align 8
+ ret void
+}
+; CHECK-LABEL: matrix reshape from 4x1 to 2x2 using at least 2 shuffles on behalf of:
+; CHECK-NEXT: %{{.*}} = load <4 x double>, ptr %{{.*}}, align 8
+
+define void @multiply_ntt(ptr %A, ptr %B, ptr %C, ptr %R) {
+entry:
+ %a = load <6 x double>, ptr %A, align 16
+ %b = load <6 x double>, ptr %B, align 16
+ %c = load <8 x double>, ptr %C, align 16
+ %b_t = call <6 x double> @llvm.matrix.transpose.v6f64.v6f64(<6 x double> %b, i32 2, i32 3)
+ %c_t = call <8 x double> @llvm.matrix.transpose.v8f64.v8f64(<8 x double> %c, i32 4, i32 2)
+ %m1 = call <12 x double> @llvm.matrix.multiply.v12f64.v6f64.v8f64(<6 x double> %b_t, <8 x double> %c_t, i32 3, i32 2, i32 4)
+ %m2 = call <8 x double> @llvm.matrix.multiply.v8f64.v6f64.v12f64(<6 x double> %a, <12 x double> %m1, i32 2, i32 3, i32 4)
+ store <8 x double> %m2, ptr %R, align 16
+ ret void
+}
+; CHECK-LABEL: flattening a 2x3 matrix:
+; CHECK-NEXT: %{{.*}} = load <6 x double>, ptr %{{.*}}, align 16
+; CHECK-NEXT: because we do not have a shape-aware lowering for its user:
+; CHECK-NEXT: %{{.*}} = shufflevector <6 x double> %{{.*}}, <6 x double> poison, <2 x i32> <i32 4, i32 5>
+
+; CHECK: flattening a 4x3 matrix:
+; CHECK-NEXT: %{{.*}} = call <12 x double> @llvm.matrix.multiply.v12f64.v8f64.v6f64(<8 x double> %{{.*}}, <6 x double> %{{.*}}, i32 4, i32 2, i32 3)
+; CHECK-NEXT: because we do not have a shape-aware lowering for its user:
+; CHECK-NEXT: %{{.*}} = shufflevector <12 x double> %{{.*}}, <12 x double> poison, <4 x i32> <i32 8, i32 9, i32 10, i32 11>
\ No newline at end of file
>From 3ab763b4c8cdaa48872edd2f636702762380020f Mon Sep 17 00:00:00 2001
From: Jon Roelofs <jonathan_roelofs at apple.com>
Date: Mon, 9 Jun 2025 14:57:11 -0700
Subject: [PATCH 4/6] add one last test
---
.../Transforms/LowerMatrixIntrinsics/flatten.ll | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/llvm/test/Transforms/LowerMatrixIntrinsics/flatten.ll b/llvm/test/Transforms/LowerMatrixIntrinsics/flatten.ll
index 0013cd5342a18..8a928c36baffd 100644
--- a/llvm/test/Transforms/LowerMatrixIntrinsics/flatten.ll
+++ b/llvm/test/Transforms/LowerMatrixIntrinsics/flatten.ll
@@ -43,7 +43,19 @@ entry:
; CHECK-NEXT: because we do not have a shape-aware lowering for its user:
; CHECK-NEXT: %{{.*}} = shufflevector <6 x double> %{{.*}}, <6 x double> poison, <2 x i32> <i32 4, i32 5>
-; CHECK: flattening a 4x3 matrix:
+; CHECK-LABEL: flattening a 4x3 matrix:
; CHECK-NEXT: %{{.*}} = call <12 x double> @llvm.matrix.multiply.v12f64.v8f64.v6f64(<8 x double> %{{.*}}, <6 x double> %{{.*}}, i32 4, i32 2, i32 3)
; CHECK-NEXT: because we do not have a shape-aware lowering for its user:
-; CHECK-NEXT: %{{.*}} = shufflevector <12 x double> %{{.*}}, <12 x double> poison, <4 x i32> <i32 8, i32 9, i32 10, i32 11>
\ No newline at end of file
+; CHECK-NEXT: %{{.*}} = shufflevector <12 x double> %{{.*}}, <12 x double> poison, <4 x i32> <i32 8, i32 9, i32 10, i32 11>
+
+
+define void @redundant_transpose_of_shuffle(<4 x float> %m, ptr %dst) {
+entry:
+ %shuffle = shufflevector <4 x float> %m, <4 x float> zeroinitializer, <4 x i32> zeroinitializer
+ %t = tail call <4 x float> @llvm.matrix.transpose.v3f32(<4 x float> %shuffle, i32 1, i32 4)
+ store <4 x float> %t, ptr %dst, align 4
+ ret void
+}
+
+; CHECK-LABEL: splitting a 4x1 matrix with 1 shuffles beacuse we do not have a shape-aware lowering for its def:
+; CHECK-NEXT: %{{.*}} = shufflevector <4 x float> %{{.*}}, <4 x float> zeroinitializer, <4 x i32> zeroinitializer
\ No newline at end of file
>From f3f629325b8b51d8ae7f5ed348522c54f72abccf Mon Sep 17 00:00:00 2001
From: Jon Roelofs <jonathan_roelofs at apple.com>
Date: Mon, 9 Jun 2025 15:02:10 -0700
Subject: [PATCH 5/6] emit statistics
---
llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
index 7964b9c4932d3..354c12c1d3cf8 100644
--- a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
@@ -22,6 +22,7 @@
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/DomTreeUpdater.h"
#include "llvm/Analysis/LoopInfo.h"
@@ -53,6 +54,10 @@ using namespace PatternMatch;
#define DEBUG_TYPE "lower-matrix-intrinsics"
+STATISTIC(FlattenedMatrices, "Number of matrix flattenings");
+STATISTIC(ReshapedMatrices, "Number of matrix reshapes");
+STATISTIC(SplitMatrices, "Number of matrix splits");
+
static cl::opt<bool>
FuseMatrix("fuse-matrix", cl::init(true), cl::Hidden,
cl::desc("Enable/disable fusing matrix instructions."));
@@ -597,11 +602,13 @@ class LowerMatrixIntrinsics {
dbgs() << "matrix reshape from " << Found->second.shape() << " to "
<< SI << " using at least " << SplitVecs.size()
<< " shuffles on behalf of:\n" << *Inst << '\n';
+ ReshapedMatrices++;
} else if (!ShapeMap.contains(MatrixVal)) {
dbgs() << "splitting a " << SI << " matrix with " << SplitVecs.size()
<< " shuffles beacuse we do not have a shape-aware lowering for "
"its def:\n"
<< *Inst << '\n';
+ SplitMatrices++;
} else {
// The ShapeMap has it, so it's a case where we're being lowered
// before the def, and we expect that InstCombine will clean things up
@@ -1428,6 +1435,7 @@ class LowerMatrixIntrinsics {
<< "\nbecause we do not have a shape-aware lowering for its "
"user:\n"
<< *User << '\n';);
+ FlattenedMatrices++;
}
U.set(Flattened);
}
>From ff8399deb253b05ea1895f79be8ed6b62e83189e Mon Sep 17 00:00:00 2001
From: Jon Roelofs <jonathan_roelofs at apple.com>
Date: Mon, 9 Jun 2025 15:13:41 -0700
Subject: [PATCH 6/6] clang-format
---
llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
index 354c12c1d3cf8..1d05cd47fa0cf 100644
--- a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
@@ -601,7 +601,8 @@ class LowerMatrixIntrinsics {
// that embedInVector created.
dbgs() << "matrix reshape from " << Found->second.shape() << " to "
<< SI << " using at least " << SplitVecs.size()
- << " shuffles on behalf of:\n" << *Inst << '\n';
+ << " shuffles on behalf of:\n"
+ << *Inst << '\n';
ReshapedMatrices++;
} else if (!ShapeMap.contains(MatrixVal)) {
dbgs() << "splitting a " << SI << " matrix with " << SplitVecs.size()
@@ -1431,7 +1432,8 @@ class LowerMatrixIntrinsics {
Flattened = Matrix.embedInVector(Builder);
LLVM_DEBUG(
if (Instruction *User = dyn_cast<Instruction>(U.getUser())) dbgs()
- << "flattening a " << Matrix.shape() << " matrix:\n" << *Inst
+ << "flattening a " << Matrix.shape() << " matrix:\n"
+ << *Inst
<< "\nbecause we do not have a shape-aware lowering for its "
"user:\n"
<< *User << '\n';);
More information about the llvm-commits
mailing list