[𝘀𝗽𝗿] initial version

Created using spr 1.3.8-beta.1-arichardson
This commit is contained in:
Alexander Richardson 2026-08-01 11:44:30 -07:00
parent b94b699857
commit 004ebf744c
2 changed files with 6 additions and 2 deletions

View file

@ -102,7 +102,7 @@ include "Common/RegClassByHwModeCommon.td"
// ASMMATCHER: switch (Kind) {
// ASMMATCHER: if (Operand.isReg() && Kind > MCK_LAST_REGISTER && Kind <= MCK_LAST_REGCLASS_BY_HWMODE) {
// ASMMATCHER: if (Kind > MCK_LAST_REGISTER && Kind <= MCK_LAST_REGCLASS_BY_HWMODE) {
// ASMMATCHER-NEXT: static constexpr MatchClassKind RegClassByHwModeMatchTable[4][3] = {
// ASMMATCHER-NEXT: { // DefaultMode
// ASMMATCHER-NEXT: MCK_PtrRegs32, // MyPtrRC

View file

@ -2569,7 +2569,11 @@ static void emitValidateOperandClass(const CodeGenTarget &Target,
unsigned NumClassesByHwMode = RegClassesByHwMode.size();
if (!RegClassesByHwMode.empty()) {
OS << " if (Operand.isReg() && Kind > MCK_LAST_REGISTER &&"
// Resolve RegClassByHwMode kinds to their concrete class regardless of
// whether Operand is actually a register, so that the diagnostic
// fallback paths below (for both register and non-register operands)
// see a concrete class rather than an unresolved by-hwmode one.
OS << " if (Kind > MCK_LAST_REGISTER &&"
" Kind <= MCK_LAST_REGCLASS_BY_HWMODE) {\n";
const CodeGenHwModes &CGH = Target.getHwModes();