Skip to content

Commit b4f5e62

Browse files
toppercgithub-actions[bot]
authored andcommitted
Automerge: [TableGen] Strengthen check for what operands can be an immediate in CompressInstEmitter. (#150568)
Registers can be represented by RegisterOperand, not just RegisterClass. Instead of trying to block certain classes, only allow Operand.
2 parents 112dc60 + bd91e8a commit b4f5e62

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)