From bd1c51d24595a8296a5f0e645f143e60e0292df1 Mon Sep 17 00:00:00 2001 From: yanming Date: Fri, 7 Jul 2023 12:38:53 +0800 Subject: [PATCH] [TableGen] Set tied to operand custom flag if current operand has tied operand. --- llvm/utils/TableGen/CodeGenInstruction.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/llvm/utils/TableGen/CodeGenInstruction.cpp b/llvm/utils/TableGen/CodeGenInstruction.cpp index c87ad34c8b24..8bc09f1d8aa6 100644 --- a/llvm/utils/TableGen/CodeGenInstruction.cpp +++ b/llvm/utils/TableGen/CodeGenInstruction.cpp @@ -409,6 +409,12 @@ static void ParseCustomConstraint(StringRef CStr, CGIOperandList &Ops, "15] for custom constraint: '" + CStr + "'"); + int TiedFlatOp = + Ops[Op.first].Constraints[Op.second].getConstraint(MCOI::TIED_TO); + + if (TiedFlatOp != -1) + Op = Ops.getSubOperandNumber(TiedFlatOp); + // Build the string for the operand if (Ops[Op.first].Constraints[Op.second].isCustom()) PrintFatalError(Rec->getLoc(),