[llvm] [ARM][TableGen][MC] Change the ARM mnemonic operands to be optional for ASM parsing (PR #83436)
Alfie Richards via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 6 06:18:57 PST 2024
================
@@ -12811,11 +12930,24 @@ unsigned ARMAsmParser::validateTargetOperandClass(MCParsedAsmOperand &AsmOp,
if (hasV8Ops() && Op.isReg() && Op.getReg() == ARM::SP)
return Match_Success;
return Match_rGPR;
- case MCK_GPRPair:
- if (Op.isReg() &&
- MRI->getRegClass(ARM::GPRRegClassID).contains(Op.getReg()))
+ // If trying to match a VecListDPair with a Q register, convert Q to list
+ case MCK_VecListDPair:
+ if (Op.isQReg() && !hasMVE()) {
+ auto DPair = getDRegFromQReg(Op.getReg());
+ DPair = MRI->getMatchingSuperReg(
+ DPair, ARM::dsub_0, &ARMMCRegisterClasses[ARM::DPairRegClassID]);
+ Op.setVecListDPair(DPair);
----------------
AlfieRichardsArm wrote:
Ah the mutation not being reversible for future matching is a good point, I hadn't thought about that. I think in this case its okay as the circumstances where this conversion would happen are very specific but I will add a comment explaining at the very least.
https://github.com/llvm/llvm-project/pull/83436
More information about the llvm-commits
mailing list