Skip to content

Commit ba5aab4

Browse files
committed
don't complain about things in the ShapeMap
1 parent 92890b0 commit ba5aab4

File tree

2 files changed

+5
-93
lines changed

2 files changed

+5
-93
lines changed

llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ class LowerMatrixIntrinsics {
584584
<< ore::NV("ToCols", SI.NumColumns) << " using at least "
585585
<< ore::NV("Shuffles", SplitVecs.size()) << " shuffles";
586586
});
587-
} else {
587+
} else if (!ShapeMap.contains(MatrixVal)) {
588588
ORE->emit([&]() {
589589
return OptimizationRemarkMissed(DEBUG_TYPE,
590590
"unknown-shape-lowering-def", Inst)
@@ -596,6 +596,10 @@ class LowerMatrixIntrinsics {
596596
<< ore::NV("Instr", Inst) << ore::setExtraArgs()
597597
<< ore::NV("Opcode", Inst->getOpcodeName());
598598
});
599+
} else {
600+
// The ShapeMap has it, so it's a case where we're being lowered
601+
// before the def, and we expect that InstCombine will clean things up
602+
// afterward.
599603
}
600604
}
601605
}

llvm/test/Transforms/LowerMatrixIntrinsics/transpose-opts.ll

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -50,38 +50,6 @@ entry:
5050
}
5151

5252
define void @multiply_ntt(ptr %A, ptr %B, ptr %C, ptr %R) {
53-
; REMARK-LABEL: Name: unknown-shape-lowering-def
54-
; REMARK-NEXT: Function: multiply_ntt
55-
; REMARK-NEXT: Args:
56-
; REMARK-NEXT: - String: 'splitting a '
57-
; REMARK-NEXT: - Rows: '2'
58-
; REMARK-NEXT: - String: x
59-
; REMARK-NEXT: - Cols: '3'
60-
; REMARK-NEXT: - String: ' matrix '
61-
; REMARK-NEXT: - String: ' with '
62-
; REMARK-NEXT: - Shuffles: '3'
63-
; REMARK-NEXT: - String: ' shuffles because we do not have a shape-aware lowering for its def: '
64-
; REMARK-NEXT: - Instr: load
65-
; REMARK-NEXT: - Opcode: load
66-
; REMARK-NEXT: ...
67-
; REMARK-NEXT: --- !Missed
68-
; REMARK-NEXT: Pass: lower-matrix-intrinsics
69-
; REMARK-LABEL: Name: unknown-shape-lowering-def
70-
; REMARK-NEXT: Function: multiply_ntt
71-
; REMARK-NEXT: Args:
72-
; REMARK-NEXT: - String: 'splitting a '
73-
; REMARK-NEXT: - Rows: '4'
74-
; REMARK-NEXT: - String: x
75-
; REMARK-NEXT: - Cols: '3'
76-
; REMARK-NEXT: - String: ' matrix '
77-
; REMARK-NEXT: - String: ' with '
78-
; REMARK-NEXT: - Shuffles: '3'
79-
; REMARK-NEXT: - String: ' shuffles because we do not have a shape-aware lowering for its def: '
80-
; REMARK-NEXT: - Instr: 'call <12 x double> @llvm.matrix.multiply.v12f64.v8f64.v6f64'
81-
; REMARK-NEXT: - Opcode: call
82-
; REMARK-NEXT: ...
83-
; REMARK-NEXT: --- !Missed
84-
; REMARK-NEXT: Pass: lower-matrix-intrinsics
8553
; REMARK-LABEL: Name: unknown-shape-lowering-use
8654
; REMARK-NEXT: Function: multiply_ntt
8755
; REMARK-NEXT: Args:
@@ -499,38 +467,6 @@ entry:
499467
}
500468

501469
define void @multiply_nt_t(ptr %A, ptr %B, ptr %C) {
502-
; REMARK-LABEL: Name: unknown-shape-lowering-def
503-
; REMARK-NEXT: Function: multiply_nt_t
504-
; REMARK-NEXT: Args:
505-
; REMARK-NEXT: - String: 'splitting a '
506-
; REMARK-NEXT: - Rows: '4'
507-
; REMARK-NEXT: - String: x
508-
; REMARK-NEXT: - Cols: '3'
509-
; REMARK-NEXT: - String: ' matrix '
510-
; REMARK-NEXT: - String: ' with '
511-
; REMARK-NEXT: - Shuffles: '3'
512-
; REMARK-NEXT: - String: ' shuffles because we do not have a shape-aware lowering for its def: '
513-
; REMARK-NEXT: - Instr: load
514-
; REMARK-NEXT: - Opcode: load
515-
; REMARK-NEXT: ...
516-
; REMARK-NEXT: --- !Missed
517-
; REMARK-NEXT: Pass: lower-matrix-intrinsics
518-
; REMARK-LABEL: Name: unknown-shape-lowering-def
519-
; REMARK-NEXT: Function: multiply_nt_t
520-
; REMARK-NEXT: Args:
521-
; REMARK-NEXT: - String: 'splitting a '
522-
; REMARK-NEXT: - Rows: '2'
523-
; REMARK-NEXT: - String: x
524-
; REMARK-NEXT: - Cols: '3'
525-
; REMARK-NEXT: - String: ' matrix '
526-
; REMARK-NEXT: - String: ' with '
527-
; REMARK-NEXT: - Shuffles: '3'
528-
; REMARK-NEXT: - String: ' shuffles because we do not have a shape-aware lowering for its def: '
529-
; REMARK-NEXT: - Instr: load
530-
; REMARK-NEXT: - Opcode: load
531-
; REMARK-NEXT: ...
532-
; REMARK-NEXT: --- !Missed
533-
; REMARK-NEXT: Pass: lower-matrix-intrinsics
534470
; REMARK-LABEL: Name: unknown-shape-lowering-use
535471
; REMARK-NEXT: Function: multiply_nt_t
536472
; REMARK-NEXT: Args:
@@ -695,34 +631,6 @@ entry:
695631
}
696632

697633
define void @multiply_ntt_t(ptr %A, ptr %B, ptr %C, ptr %R) {
698-
; REMARK-LABEL: Name: unknown-shape-lowering-def
699-
; REMARK-NEXT: Function: multiply_ntt_t
700-
; REMARK-NEXT: Args:
701-
; REMARK-NEXT: - String: 'splitting a '
702-
; REMARK-NEXT: - Rows: '3'
703-
; REMARK-NEXT: - String: x
704-
; REMARK-NEXT: - Cols: '3'
705-
; REMARK-NEXT: - String: ' matrix '
706-
; REMARK-NEXT: - String: ' with '
707-
; REMARK-NEXT: - Shuffles: '3'
708-
; REMARK-NEXT: - String: ' shuffles because we do not have a shape-aware lowering for its def: '
709-
; REMARK-NEXT: - Instr: 'call <9 x double> @llvm.matrix.multiply.v9f64.v9f64.v9f64'
710-
; REMARK-NEXT: - Opcode: call
711-
; REMARK-NEXT: ...
712-
; REMARK-LABEL: Name: unknown-shape-lowering-def
713-
; REMARK-NEXT: Function: multiply_ntt_t
714-
; REMARK-NEXT: Args:
715-
; REMARK-NEXT: - String: 'splitting a '
716-
; REMARK-NEXT: - Rows: '3'
717-
; REMARK-NEXT: - String: x
718-
; REMARK-NEXT: - Cols: '3'
719-
; REMARK-NEXT: - String: ' matrix '
720-
; REMARK-NEXT: - String: ' with '
721-
; REMARK-NEXT: - Shuffles: '3'
722-
; REMARK-NEXT: - String: ' shuffles because we do not have a shape-aware lowering for its def: '
723-
; REMARK-NEXT: - Instr: load
724-
; REMARK-NEXT: - Opcode: load
725-
; REMARK-NEXT: ...
726634
; REMARK-LABEL: Name: unknown-shape-lowering-use
727635
; REMARK-NEXT: Function: multiply_ntt_t
728636
; REMARK-NEXT: Args:

0 commit comments

Comments
 (0)