Skip to content

Commit c30d5cb

Browse files
toppercGroverkss
authored andcommitted
[GISel][AArch64][RISCV] Don't call markAllIdxsAsCovered from minScalarSameAs/maxScalarSameAs. (llvm#115637)
The predicate isn't user defined so we don't need to call markAllIdxsAsCovered. Call actionIf instead of widenScalarIf/narrowScalarIf.
1 parent 9dc9d07 commit c30d5cb

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,8 @@ class LegalizeRuleSet {
11181118
/// Widen the scalar to match the size of another.
11191119
LegalizeRuleSet &minScalarSameAs(unsigned TypeIdx, unsigned LargeTypeIdx) {
11201120
typeIdx(TypeIdx);
1121-
return widenScalarIf(
1121+
return actionIf(
1122+
LegalizeAction::WidenScalar,
11221123
[=](const LegalityQuery &Query) {
11231124
return Query.Types[LargeTypeIdx].getScalarSizeInBits() >
11241125
Query.Types[TypeIdx].getSizeInBits();
@@ -1129,7 +1130,8 @@ class LegalizeRuleSet {
11291130
/// Narrow the scalar to match the size of another.
11301131
LegalizeRuleSet &maxScalarSameAs(unsigned TypeIdx, unsigned NarrowTypeIdx) {
11311132
typeIdx(TypeIdx);
1132-
return narrowScalarIf(
1133+
return actionIf(
1134+
LegalizeAction::NarrowScalar,
11331135
[=](const LegalityQuery &Query) {
11341136
return Query.Types[NarrowTypeIdx].getScalarSizeInBits() <
11351137
Query.Types[TypeIdx].getSizeInBits();

llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@
111111
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
112112
#
113113
# DEBUG-NEXT: G_BUILD_VECTOR (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
114-
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
115-
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
114+
# DEBUG-NEXT: .. the first uncovered type index: 2, OK
115+
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
116116
#
117117
# DEBUG-NEXT: G_BUILD_VECTOR_TRUNC (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
118118
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
@@ -678,8 +678,8 @@
678678
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
679679
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
680680
# DEBUG-NEXT: G_CTLZ (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
681-
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
682-
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
681+
# DEBUG-NEXT: .. the first uncovered type index: 2, OK
682+
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
683683
# DEBUG-NEXT: G_CTLZ_ZERO_UNDEF (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
684684
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
685685
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected

llvm/test/CodeGen/RISCV/GlobalISel/legalizer-info-validation.mir

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,16 @@
326326
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
327327
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
328328
# DEBUG-NEXT: G_SHL (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
329-
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
330-
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
329+
# DEBUG-NEXT: .. the first uncovered type index: 2, OK
330+
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
331331
# DEBUG-NEXT: G_LSHR (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
332332
# DEBUG-NEXT: .. opcode {{[0-9]+}} is aliased to {{[0-9]+}}
333-
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
334-
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
333+
# DEBUG-NEXT: .. the first uncovered type index: 2, OK
334+
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
335335
# DEBUG-NEXT: G_ASHR (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
336336
# DEBUG-NEXT: .. opcode {{[0-9]+}} is aliased to {{[0-9]+}}
337-
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
338-
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
337+
# DEBUG-NEXT: .. the first uncovered type index: 2, OK
338+
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
339339
# DEBUG-NEXT: G_FSHL (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
340340
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
341341
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
@@ -654,21 +654,21 @@
654654
# DEBUG-NEXT: .. imm index coverage check SKIPPED: no rules defined
655655
# DEBUG-NEXT: G_CTTZ (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
656656
# DEBUG-NEXT: .. opcode {{[0-9]+}} is aliased to {{[0-9]+}}
657-
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
658-
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
657+
# DEBUG-NEXT: .. the first uncovered type index: 2, OK
658+
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
659659
# DEBUG-NEXT: G_CTTZ_ZERO_UNDEF (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
660660
# DEBUG-NEXT: .. opcode {{[0-9]+}} is aliased to {{[0-9]+}}
661661
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
662662
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
663663
# DEBUG-NEXT: G_CTLZ (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
664-
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
665-
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
664+
# DEBUG-NEXT: .. the first uncovered type index: 2, OK
665+
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
666666
# DEBUG-NEXT: G_CTLZ_ZERO_UNDEF (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
667667
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
668668
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
669669
# DEBUG-NEXT: G_CTPOP (opcode {{[0-9]+}}): 2 type indices, 0 imm indices
670-
# DEBUG-NEXT: .. type index coverage check SKIPPED: user-defined predicate detected
671-
# DEBUG-NEXT: .. imm index coverage check SKIPPED: user-defined predicate detected
670+
# DEBUG-NEXT: .. the first uncovered type index: 2, OK
671+
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK
672672
# DEBUG-NEXT: G_BSWAP (opcode {{[0-9]+}}): 1 type index, 0 imm indices
673673
# DEBUG-NEXT: .. the first uncovered type index: 1, OK
674674
# DEBUG-NEXT: .. the first uncovered imm index: 0, OK

0 commit comments

Comments
 (0)