[llvm] r262880 - [MIR] Print the type of generic machine instructions.
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 7 16:29:15 PST 2016
Author: qcolombet
Date: Mon Mar 7 18:29:15 2016
New Revision: 262880
URL: http://llvm.org/viewvc/llvm-project?rev=262880&view=rev
Log:
[MIR] Print the type of generic machine instructions.
Modified:
llvm/trunk/lib/CodeGen/MIRPrinter.cpp
llvm/trunk/test/CodeGen/MIR/X86/generic-virtual-registers.mir
Modified: llvm/trunk/lib/CodeGen/MIRPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRPrinter.cpp?rev=262880&r1=262879&r2=262880&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/MIRPrinter.cpp Mon Mar 7 18:29:15 2016
@@ -552,6 +552,10 @@ void MIPrinter::print(const MachineInstr
if (MI.getFlag(MachineInstr::FrameSetup))
OS << "frame-setup ";
OS << TII->getName(MI.getOpcode());
+ if (isPreISelGenericOpcode(MI.getOpcode())) {
+ assert(MI.getType() && "Generic instructions must have a type");
+ OS << ' ' << *MI.getType();
+ }
if (I < E)
OS << ' ';
Modified: llvm/trunk/test/CodeGen/MIR/X86/generic-virtual-registers.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/MIR/X86/generic-virtual-registers.mir?rev=262880&r1=262879&r2=262880&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/MIR/X86/generic-virtual-registers.mir (original)
+++ llvm/trunk/test/CodeGen/MIR/X86/generic-virtual-registers.mir Mon Mar 7 18:29:15 2016
@@ -13,6 +13,6 @@ registers:
body: |
bb.0.entry:
liveins: %edi
- ; CHECK: %0(32) = G_ADD %edi
+ ; CHECK: %0(32) = G_ADD i32 %edi
%0(32) = G_ADD i32 %edi, %edi
...
More information about the llvm-commits
mailing list