[PATCH] D29224: [AMDGPU] Gram MCSubtargetInfo from TargetMachine instead of constructing it
Konstantin Zhuravlyov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 27 08:30:08 PST 2017
kzhuravl created this revision.
Herald added a reviewer: tstellarAMD.
Herald added subscribers: tpr, tony-tye, yaxunl, nhaehnle, wdng, arsenm.
https://reviews.llvm.org/D29224
Files:
lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
Index: lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
===================================================================
--- lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+++ lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
@@ -103,17 +103,12 @@
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");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29224.86057.patch
Type: text/x-patch
Size: 985 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170127/7d804d45/attachment.bin>
More information about the llvm-commits
mailing list