This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Don't use TargetStreamer if it has not been initialized
AbandonedPublic

Authored by kzhuravl on Oct 16 2017, 9:19 AM.

Details

Reviewers
arsenm
t-tye

Diff Detail

Event Timeline

kzhuravl created this revision.Oct 16 2017, 9:19 AM

Why is this necessary? Do other targets need to do ths?

javed.absar added inline comments.
lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
1232

Instead of the numerous lambda functions making the code reading complicated, Could one make it neater like this ?

234: if (AMDGPUTargetStreamer *S =getTargetStreamer() )
235: Streamer->EmitGPUSymbolType(...)
236

AMDGPUTargetStreamer *getAMDGPUTargetStreamer( ) {

if (!OutStreamer)
   return nullptr;
....

}

arsenm edited edge metadata.Oct 16 2017, 2:42 PM

I also don't understand why this would be necessary. How can the streamer not be available?

I also don't understand why this would be necessary. How can the streamer not be available?

It seems like the TargetStreamer is not created if -emit-codegen-only option is passed to clang cc1. I have hit it last week here:
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/43381/

I haven't had a chance to look at other targets yet. But will when I get a chance.

That seems like a clang bug? I don't understand what the option is for, but isn't there some null streamer it's supposed to use?

kzhuravl planned changes to this revision.Oct 17 2017, 2:49 PM
kzhuravl abandoned this revision.Apr 2 2019, 12:43 PM