Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
[AMDGPU] Grab MCSubtargetInfo from TargetMachine instead of construct…
Browse files Browse the repository at this point in the history
…ing it

Differential Revision: https://reviews.llvm.org/D29224


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293318 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
kzhuravl committed Jan 27, 2017
1 parent 8a25ec8 commit 26015b4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,12 @@ void AMDGPUAsmPrinter::EmitStartOfAsmFile(Module &M) {
if (TM.getTargetTriple().getOS() != Triple::AMDHSA)
return;

// Need to construct an MCSubtargetInfo here in case we have no functions
// in the module.
std::unique_ptr<MCSubtargetInfo> STI(TM.getTarget().createMCSubtargetInfo(
TM.getTargetTriple().str(), TM.getTargetCPU(),
TM.getTargetFeatureString()));

AMDGPUTargetStreamer *TS =
static_cast<AMDGPUTargetStreamer *>(OutStreamer->getTargetStreamer());

TS->EmitDirectiveHSACodeObjectVersion(2, 1);

const MCSubtargetInfo *STI = TM.getMCSubtargetInfo();
AMDGPU::IsaVersion ISA = AMDGPU::getIsaVersion(STI->getFeatureBits());
TS->EmitDirectiveHSACodeObjectISA(ISA.Major, ISA.Minor, ISA.Stepping,
"AMD", "AMDGPU");
Expand Down

0 comments on commit 26015b4

Please sign in to comment.