[llvm] [TableGen] More generically handle tied source operands in CompressInstEmitter. (PR #146183)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 1 10:56:43 PDT 2025


================
@@ -425,29 +411,26 @@ void CompressInstEmitter::createInstOperandMapping(
         continue;
 
       unsigned DagArgIdx = OpNo - TiedCount;
-      StringMap<unsigned>::iterator SourceOp =
-          SourceOperands.find(DestDag->getArgNameStr(DagArgIdx));
+      auto SourceOp = SourceOperands.find(DestDag->getArgNameStr(DagArgIdx));
       if (SourceOp == SourceOperands.end())
         PrintFatalError(Rec->getLoc(),
                         "Output Dag operand '" +
                             DestDag->getArgNameStr(DagArgIdx) +
                             "' has no matching input Dag operand.");
 
       assert(DestDag->getArgNameStr(DagArgIdx) ==
-                 SourceDag->getArgNameStr(SourceOp->getValue()) &&
+                 SourceDag->getArgNameStr(SourceOp->getValue().first) &&
              "Incorrect operand mapping detected!\n");
 
       // Following four lines ensure the correct handling of a single tied
       // operand in the Source Inst. SourceDagOp points to the position of
       // appropriate Dag argument which is not correct in presence of tied
       // operand in the Source Inst and must be incremented by 1 to reflect
----------------
jurahul wrote:

this comment seems to be not valid anymore. Can you please update to reflect the new state?

https://github.com/llvm/llvm-project/pull/146183


More information about the llvm-commits mailing list