[PATCH] D22538: [AMDGPU] Emit read-only data to .rodata for hsa

Konstantin Zhuravlyov via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 09:06:59 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL276298: [AMDGPU] Emit read-only data to .rodata for hsa (authored by kzhuravl).

Changed prior to commit:
  https://reviews.llvm.org/D22538?vs=64570&id=64910#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D22538

Files:
  llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp
  llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll
  llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll

Index: llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp
@@ -24,7 +24,8 @@
                                                           SectionKind Kind,
                                                           Mangler &Mang,
                                                 const TargetMachine &TM) const {
-  if (Kind.isReadOnly() && AMDGPU::isReadOnlySegment(GV))
+  if (Kind.isReadOnly() && AMDGPU::isReadOnlySegment(GV) &&
+      TM.getTargetTriple().getOS() != Triple::AMDHSA)
     return TextSection;
 
   return TargetLoweringObjectFileELF::SelectSectionForGlobal(GV, Kind, Mang, TM);
Index: llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll
===================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll
+++ llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll
@@ -38,7 +38,7 @@
 ; ASM: .size external_global_program, 4
 
 ; ASM: .type internal_readonly, at object
-; ASM: .text
+; ASM: .section .rodata.cst4,"aM", at progbits,4
 ; ASM: internal_readonly:
 ; ASM: .long 0
 ; ASM: .size internal_readonly, 4
Index: llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll
===================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll
+++ llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll
@@ -12,7 +12,7 @@
 ; GCN-NEXT: s_add_u32 s{{[0-9]+}}, s[[PC1_LO]], readonly
 ; GCN: s_addc_u32 s{{[0-9]+}}, s[[PC1_HI]], 0
 ; NOHSA: .text
-; HSA: .text
+; HSA: .section .rodata
 ; GCN: readonly:
 ; GCN: readonly2:
 define void @main(i32 %index, float addrspace(1)* %out) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22538.64910.patch
Type: text/x-patch
Size: 1755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160721/3d9cfae7/attachment.bin>


More information about the llvm-commits mailing list