[PATCH] D29224: [AMDGPU] Grab MCSubtargetInfo from TargetMachine instead of constructing it

Konstantin Zhuravlyov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 10:44:01 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL293318: [AMDGPU] Grab MCSubtargetInfo from TargetMachine instead of constructing it (authored by kzhuravl).

Changed prior to commit:
  https://reviews.llvm.org/D29224?vs=86057&id=86074#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D29224

Files:
  llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp


Index: llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+++ llvm/trunk/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.86074.patch
Type: text/x-patch
Size: 1018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170127/c739790f/attachment.bin>


More information about the llvm-commits mailing list