[llvm] r320061 - [CodeGen] Fix index when printing tied machine operands

Francis Visoiu Mistrih via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 09:12:30 PST 2017


Author: thegameg
Date: Thu Dec  7 09:12:30 2017
New Revision: 320061

URL: http://llvm.org/viewvc/llvm-project?rev=320061&view=rev
Log:
[CodeGen] Fix index when printing tied machine operands

Modified:
    llvm/trunk/lib/CodeGen/MachineInstr.cpp

Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=320061&r1=320060&r2=320061&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Thu Dec  7 09:12:30 2017
@@ -1289,7 +1289,7 @@ void MachineInstr::print(raw_ostream &OS
     OS << " ";
     const unsigned OpIdx = InlineAsm::MIOp_AsmString;
     LLT TypeToPrint = MRI ? getTypeToPrint(OpIdx, PrintedTypes, *MRI) : LLT{};
-    unsigned TiedOperandIdx = getTiedOperandIdx(StartOp);
+    unsigned TiedOperandIdx = getTiedOperandIdx(OpIdx);
     getOperand(OpIdx).print(OS, MST, TypeToPrint, /*PrintDef=*/true,
                             ShouldPrintRegisterTies, TiedOperandIdx, TRI,
                             IntrinsicInfo);
@@ -1337,7 +1337,7 @@ void MachineInstr::print(raw_ostream &OS
         OS << "!\"" << DIV->getName() << '\"';
       else {
         LLT TypeToPrint = MRI ? getTypeToPrint(i, PrintedTypes, *MRI) : LLT{};
-        unsigned TiedOperandIdx = getTiedOperandIdx(StartOp);
+        unsigned TiedOperandIdx = getTiedOperandIdx(i);
         MO.print(OS, MST, TypeToPrint, /*PrintDef=*/true,
                  ShouldPrintRegisterTies, TiedOperandIdx, TRI, IntrinsicInfo);
       }
@@ -1404,7 +1404,7 @@ void MachineInstr::print(raw_ostream &OS
       AsmDescOp += 1 + InlineAsm::getNumOperandRegisters(Flag);
     } else {
       LLT TypeToPrint = MRI ? getTypeToPrint(i, PrintedTypes, *MRI) : LLT{};
-      unsigned TiedOperandIdx = getTiedOperandIdx(StartOp);
+      unsigned TiedOperandIdx = getTiedOperandIdx(i);
       MO.print(OS, MST, TypeToPrint, /*PrintDef=*/true, ShouldPrintRegisterTies,
                TiedOperandIdx, TRI, IntrinsicInfo);
     }




More information about the llvm-commits mailing list