[PATCH] D27732: [AMDGPU] Do not emit .AMDGPU.config section for amdhsa

Konstantin Zhuravlyov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 14:19:40 PST 2016


kzhuravl created this revision.
kzhuravl added a reviewer: tstellarAMD.
kzhuravl added a subscriber: llvm-commits.
Herald added subscribers: tony-tye, yaxunl, nhaehnle, wdng, arsenm.

https://reviews.llvm.org/D27732

Files:
  lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
  test/CodeGen/AMDGPU/hsa.ll


Index: test/CodeGen/AMDGPU/hsa.ll
===================================================================
--- test/CodeGen/AMDGPU/hsa.ll
+++ test/CodeGen/AMDGPU/hsa.ll
@@ -39,6 +39,7 @@
 ; HSA-VI: .hsa_code_object_isa 8,0,1,"AMD","AMDGPU"
 
 ; HSA: .text
+; HSA-NOT: .AMDGPU.config
 
 ; HSA: .amdgpu_hsa_kernel simple
 ; HSA: {{^}}simple:
Index: lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
===================================================================
--- lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+++ lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
@@ -176,12 +176,14 @@
 
   SetupMachineFunction(MF);
 
+  const AMDGPUSubtarget &STM = MF.getSubtarget<AMDGPUSubtarget>();
   MCContext &Context = getObjFileLowering().getContext();
-  MCSectionELF *ConfigSection =
-      Context.getELFSection(".AMDGPU.config", ELF::SHT_PROGBITS, 0);
-  OutStreamer->SwitchSection(ConfigSection);
+  if (!STM.isAmdHsaOS()) {
+    MCSectionELF *ConfigSection =
+        Context.getELFSection(".AMDGPU.config", ELF::SHT_PROGBITS, 0);
+    OutStreamer->SwitchSection(ConfigSection);
+  }
 
-  const AMDGPUSubtarget &STM = MF.getSubtarget<AMDGPUSubtarget>();
   SIProgramInfo KernelInfo;
   if (STM.getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS) {
     getSIProgramInfo(KernelInfo, MF);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27732.81301.patch
Type: text/x-patch
Size: 1259 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161213/83e48765/attachment.bin>


More information about the llvm-commits mailing list