Skip to content

Commit bd91e8a

Browse files
authored
[TableGen] Strengthen check for what operands can be an immediate in CompressInstEmitter. (llvm#150568)
Registers can be represented by RegisterOperand, not just RegisterClass. Instead of trying to block certain classes, only allow Operand.
1 parent 4b1ca9c commit bd91e8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/utils/TableGen/CompressInstEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ void CompressInstEmitter::addDagOperandMapping(const Record *Rec,
275275
OperandMap[OpNo].Kind = OpData::Operand;
276276
} else if (const auto *II = dyn_cast<IntInit>(Dag->getArg(DAGOpNo))) {
277277
// Validate that corresponding instruction operand expects an immediate.
278-
if (OpndRec->isSubClassOf("RegisterClass"))
278+
if (!OpndRec->isSubClassOf("Operand"))
279279
PrintFatalError(Rec->getLoc(), "Error in Dag '" + Dag->getAsString() +
280280
"' Found immediate: '" +
281281
II->getAsString() +

0 commit comments

Comments
 (0)