Index: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp =================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -724,19 +724,27 @@ /// that is an implicit def. void AsmPrinter::emitImplicitDef(const MachineInstr *MI) const { unsigned RegNo = MI->getOperand(0).getReg(); - OutStreamer->AddComment(Twine("implicit-def: ") + - MMI->getContext().getRegisterInfo()->getName(RegNo)); + + SmallString<128> Str; + raw_svector_ostream OS(Str); + OS << "implicit-def: " + << PrintReg(RegNo, MF->getSubtarget().getRegisterInfo()); + + OutStreamer->AddComment(OS.str()); OutStreamer->AddBlankLine(); } static void emitKill(const MachineInstr *MI, AsmPrinter &AP) { - std::string Str = "kill:"; + std::string Str; + raw_string_ostream OS(Str); + OS << "kill:"; for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { const MachineOperand &Op = MI->getOperand(i); assert(Op.isReg() && "KILL instruction must have only register operands"); - Str += ' '; - Str += AP.MMI->getContext().getRegisterInfo()->getName(Op.getReg()); - Str += (Op.isDef() ? "" : ""); + OS << ' ' + << PrintReg(Op.getReg(), + AP.MF->getSubtarget().getRegisterInfo()) + << (Op.isDef() ? "" : ""); } AP.OutStreamer->AddComment(Str); AP.OutStreamer->AddBlankLine(); @@ -811,7 +819,7 @@ } if (Deref) OS << '['; - OS << AP.MMI->getContext().getRegisterInfo()->getName(Reg); + OS << PrintReg(Reg, AP.MF->getSubtarget().getRegisterInfo()); } if (Deref) Index: llvm/trunk/test/CodeGen/AMDGPU/llvm.dbg.value.ll =================================================================== --- llvm/trunk/test/CodeGen/AMDGPU/llvm.dbg.value.ll +++ llvm/trunk/test/CodeGen/AMDGPU/llvm.dbg.value.ll @@ -2,7 +2,7 @@ ; CHECK-LABEL: {{^}}test_debug_value: ; CHECK: s_load_dwordx2 -; CHECK: DEBUG_VALUE: test_debug_value:globalptr_arg <- SGPR0_SGPR1 +; CHECK: DEBUG_VALUE: test_debug_value:globalptr_arg <- %SGPR0_SGPR1 ; CHECK: buffer_store_dword ; CHECK: s_endpgm define void @test_debug_value(i32 addrspace(1)* nocapture %globalptr_arg) #0 !dbg !4 { Index: llvm/trunk/test/CodeGen/ARM/debug-info-arg.ll =================================================================== --- llvm/trunk/test/CodeGen/ARM/debug-info-arg.ll +++ llvm/trunk/test/CodeGen/ARM/debug-info-arg.ll @@ -11,7 +11,7 @@ tail call void @llvm.dbg.value(metadata %struct.tag_s* %c, i64 0, metadata !13, metadata !DIExpression()), !dbg !21 tail call void @llvm.dbg.value(metadata i64 %x, i64 0, metadata !14, metadata !DIExpression()), !dbg !22 tail call void @llvm.dbg.value(metadata i64 %y, i64 0, metadata !17, metadata !DIExpression()), !dbg !23 -;CHECK: @DEBUG_VALUE: foo:y <- [R7+8] +;CHECK: @DEBUG_VALUE: foo:y <- [%R7+8] tail call void @llvm.dbg.value(metadata %struct.tag_s* %ptr1, i64 0, metadata !18, metadata !DIExpression()), !dbg !24 tail call void @llvm.dbg.value(metadata %struct.tag_s* %ptr2, i64 0, metadata !19, metadata !DIExpression()), !dbg !25 %1 = icmp eq %struct.tag_s* %c, null, !dbg !26 Index: llvm/trunk/test/CodeGen/ARM/debug-info-blocks.ll =================================================================== --- llvm/trunk/test/CodeGen/ARM/debug-info-blocks.ll +++ llvm/trunk/test/CodeGen/ARM/debug-info-blocks.ll @@ -1,5 +1,5 @@ ; RUN: llc -O0 < %s | FileCheck %s -; CHECK: @DEBUG_VALUE: foobar_func_block_invoke_0:mydata <- [SP+{{[0-9]+}}] +; CHECK: @DEBUG_VALUE: foobar_func_block_invoke_0:mydata <- [%SP+{{[0-9]+}}] ; Radar 9331779 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32" target triple = "thumbv7-apple-ios" Index: llvm/trunk/test/CodeGen/ARM/debug-info-branch-folding.ll =================================================================== --- llvm/trunk/test/CodeGen/ARM/debug-info-branch-folding.ll +++ llvm/trunk/test/CodeGen/ARM/debug-info-branch-folding.ll @@ -6,8 +6,8 @@ ;CHECK-NEXT: Ltmp1 ;CHECK-NEXT: LBB0_1 -;CHECK:@DEBUG_VALUE: x <- Q4{{$}} -;CHECK-NEXT:@DEBUG_VALUE: y <- Q4{{$}} +;CHECK:@DEBUG_VALUE: x <- %Q4{{$}} +;CHECK-NEXT:@DEBUG_VALUE: y <- %Q4{{$}} @.str = external constant [13 x i8] Index: llvm/trunk/test/CodeGen/BPF/sockex2.ll =================================================================== --- llvm/trunk/test/CodeGen/BPF/sockex2.ll +++ llvm/trunk/test/CodeGen/BPF/sockex2.ll @@ -311,7 +311,7 @@ ; CHECK-LABEL: bpf_prog2: ; CHECK: ldabs_h r0, r6.data + 12 # encoding: [0x28,0x00,0x00,0x00,0x0c,0x00,0x00,0x00] ; CHECK: ldabs_h r0, r6.data + 16 # encoding: [0x28,0x00,0x00,0x00,0x10,0x00,0x00,0x00] -; CHECK: implicit-def: R1 +; CHECK: implicit-def: %R1 ; CHECK: ld_64 r1 ; CHECK-NOT: ori ; CHECK: call 1 # encoding: [0x85,0x00,0x00,0x00,0x01,0x00,0x00,0x00] Index: llvm/trunk/test/CodeGen/Mips/llvm-ir/call.ll =================================================================== --- llvm/trunk/test/CodeGen/Mips/llvm-ir/call.ll +++ llvm/trunk/test/CodeGen/Mips/llvm-ir/call.ll @@ -176,8 +176,8 @@ define hidden void @thunk_undef_double(i32 %this, double %volume) unnamed_addr align 2 { ; ALL-LABEL: thunk_undef_double: -; O32: # implicit-def: A2 -; O32: # implicit-def: A3 +; O32: # implicit-def: %A2 +; O32: # implicit-def: %A3 ; ALL: jr $25 tail call void @undef_double(i32 undef, double undef) #8 ret void Index: llvm/trunk/test/CodeGen/X86/2010-05-28-Crash.ll =================================================================== --- llvm/trunk/test/CodeGen/X86/2010-05-28-Crash.ll +++ llvm/trunk/test/CodeGen/X86/2010-05-28-Crash.ll @@ -46,7 +46,7 @@ !18 = !DIFile(filename: "f.c", directory: "/tmp") !19 = !{} -;CHECK: DEBUG_VALUE: bar:x <- E +;CHECK: DEBUG_VALUE: bar:x <- %E ;CHECK: Ltmp ;CHECK: DEBUG_VALUE: foo:y <- 1{{$}} !20 = !{i32 1, !"Debug Info Version", i32 3} Index: llvm/trunk/test/CodeGen/X86/2010-06-01-DeadArg-DbgInfo.ll =================================================================== --- llvm/trunk/test/CodeGen/X86/2010-06-01-DeadArg-DbgInfo.ll +++ llvm/trunk/test/CodeGen/X86/2010-06-01-DeadArg-DbgInfo.ll @@ -8,7 +8,7 @@ @llvm.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.foo*, i32)* @_ZN3foo3bazEi to i8*)], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] define i32 @_ZN3foo3bazEi(%struct.foo* nocapture %this, i32 %x) nounwind readnone optsize noinline ssp align 2 !dbg !8 { -;CHECK: DEBUG_VALUE: baz:this <- RDI{{$}} +;CHECK: DEBUG_VALUE: baz:this <- %RDI{{$}} entry: tail call void @llvm.dbg.value(metadata %struct.foo* %this, i64 0, metadata !15, metadata !DIExpression()), !dbg !DILocation(scope: !8) tail call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !16, metadata !DIExpression()), !dbg !DILocation(scope: !8)