Page MenuHomePhabricator

D63712.diff
No OneTemporary

File Metadata

Created
Mon, Nov 18, 11:55 PM

D63712.diff

Index: llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
@@ -206,18 +206,6 @@
if (STM.isAmdHsaOS())
HSAMetadataStream->emitKernel(*MF, CurrentProgramInfo);
-
- DumpCodeInstEmitter = nullptr;
- if (STM.dumpCode()) {
- // For -dumpcode, get the assembler out of the streamer, even if it does
- // not really want to let us have it. This only works with -filetype=obj.
- bool SaveFlag = OutStreamer->getUseAssemblerInfoForParsing();
- OutStreamer->setUseAssemblerInfoForParsing(true);
- MCAssembler *Assembler = OutStreamer->getAssemblerPtr();
- OutStreamer->setUseAssemblerInfoForParsing(SaveFlag);
- if (Assembler)
- DumpCodeInstEmitter = Assembler->getEmitterPtr();
- }
}
void AMDGPUAsmPrinter::EmitFunctionBodyEnd() {
@@ -458,6 +446,18 @@
EmitProgramInfoSI(MF, CurrentProgramInfo);
}
+ DumpCodeInstEmitter = nullptr;
+ if (STM.dumpCode()) {
+ // For -dumpcode, get the assembler out of the streamer, even if it does
+ // not really want to let us have it. This only works with -filetype=obj.
+ bool SaveFlag = OutStreamer->getUseAssemblerInfoForParsing();
+ OutStreamer->setUseAssemblerInfoForParsing(true);
+ MCAssembler *Assembler = OutStreamer->getAssemblerPtr();
+ OutStreamer->setUseAssemblerInfoForParsing(SaveFlag);
+ if (Assembler)
+ DumpCodeInstEmitter = Assembler->getEmitterPtr();
+ }
+
DisasmLines.clear();
HexLines.clear();
DisasmLineMaxLen = 0;
Index: llvm/trunk/test/CodeGen/AMDGPU/debug.ll
===================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/debug.ll
+++ llvm/trunk/test/CodeGen/AMDGPU/debug.ll
@@ -3,6 +3,8 @@
; Test for a crash in the custom assembly dump code.
+; SI: test:
+; SI: BB0_0:
; SI: s_endpgm
define amdgpu_kernel void @test(i32 addrspace(1)* %out) {
store i32 0, i32 addrspace(1)* %out

Event Timeline