[llvm] [Matrix] Add a Remark when matrices get flattened (PR #142078)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 01:59:37 PDT 2025


================
@@ -0,0 +1,38 @@
+; 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 -pass-remarks-missed=lower-matrix-intrinsics < %s -pass-remarks-output=%t -disable-output && FileCheck --input-file %t %s --check-prefix=REMARK
+
+define void @diag_3x3(ptr %in, ptr %out) {
+; REMARK-LABEL: --- !Missed
+; REMARK-NEXT: Pass:            lower-matrix-intrinsics
+; REMARK-NEXT: Name:            unknown-shape-lowering-use
+; REMARK-NEXT: Function:        diag_3x3
+; REMARK-NEXT: Args:
+; REMARK-NEXT:   - String:          'flattening a '
+; REMARK-NEXT:   - Rows:            '3'
+; REMARK-NEXT:   - String:          x
+; REMARK-NEXT:   - Cols:            '3'
+; REMARK-NEXT:   - String:          ' matrix '
+; REMARK-NEXT:   - Source:          '  %{{.*}} = call <9 x float> @llvm.matrix.column.major.load.v9f32.i64(ptr %{{.*}}, i64 3, i1 false, i32 3, i32 3)'
----------------
fhahn wrote:

IIRC we tried to avoid direct LLVM IR references in the remarks, to make them more approachable to non-LLVM developers. Might be worth keeping consistent with the syntax we use in `emitRemarks`, although the printing there could probably also be improved.

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


More information about the llvm-commits mailing list