[llvm] r291481 - MachineInstr: Print name for subreg index in SUBREG_TO_REG

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 13:38:11 PST 2017


Author: matze
Date: Mon Jan  9 15:38:10 2017
New Revision: 291481

URL: http://llvm.org/viewvc/llvm-project?rev=291481&view=rev
Log:
MachineInstr: Print name for subreg index in SUBREG_TO_REG

SUBREG_TO_REG takes a subregister index as 3rd operand, print the name
instead of a number. We already do the same for INSERT_SUBREG and
REG_SEQUENCE.

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=291481&r1=291480&r2=291481&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Mon Jan  9 15:38:10 2017
@@ -1840,7 +1840,8 @@ void MachineInstr::print(raw_ostream &OS
         OS << "!\"" << DIV->getName() << '\"';
       else
         MO.print(OS, MST, TRI);
-    } else if (TRI && (isInsertSubreg() || isRegSequence()) && MO.isImm()) {
+    } else if (TRI && (isInsertSubreg() || isRegSequence() ||
+                       (isSubregToReg() && i == 3)) && MO.isImm()) {
       OS << TRI->getSubRegIndexName(MO.getImm());
     } else if (i == AsmDescOp && MO.isImm()) {
       // Pretty print the inline asm operand descriptor.




More information about the llvm-commits mailing list