Skip to content

Commit 90eb4e2

Browse files
[AArch64] Fix missing pfalse diagnostic (#77746)
The missing diagnostic causes an ICE when a suffix other than `.B` is used in a `pfalse` instruction with a predicate-as-counter operand.
1 parent 3867e66 commit 90eb4e2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6110,6 +6110,9 @@ bool AArch64AsmParser::showMatchError(SMLoc Loc, unsigned ErrCode,
61106110
case Match_AddSubLSLImm3ShiftLarge:
61116111
return Error(Loc,
61126112
"expected 'lsl' with optional integer in range [0, 7]");
6113+
case Match_InvalidSVEPNRasPPRPredicateBReg:
6114+
return Error(Loc,
6115+
"Expected predicate-as-counter register name with .B suffix");
61136116
default:
61146117
llvm_unreachable("unexpected error code!");
61156118
}
@@ -6690,6 +6693,7 @@ bool AArch64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
66906693
case Match_InvalidSVEVectorListStrided4x16:
66916694
case Match_InvalidSVEVectorListStrided4x32:
66926695
case Match_InvalidSVEVectorListStrided4x64:
6696+
case Match_InvalidSVEPNRasPPRPredicateBReg:
66936697
case Match_MSR:
66946698
case Match_MRS: {
66956699
if (ErrorInfo >= Operands.size())

llvm/test/MC/AArch64/SVE/pfalse-diagnostics.s

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ pfalse pn16.b
1515
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
1616
// CHECK-NEXT: pfalse pn16.b
1717
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
18+
19+
pfalse pn5.d
20+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Expected predicate-as-counter register name with .B suffix
21+
// CHECK-NEXT: pfalse pn5.d
22+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

0 commit comments

Comments
 (0)