[llvm] r276298 - [AMDGPU] Emit read-only data to .rodata for hsa
Konstantin Zhuravlyov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 21 08:59:23 PDT 2016
Author: kzhuravl
Date: Thu Jul 21 10:59:23 2016
New Revision: 276298
URL: http://llvm.org/viewvc/llvm-project?rev=276298&view=rev
Log:
[AMDGPU] Emit read-only data to .rodata for hsa
Differential Revision: https://reviews.llvm.org/D22538
Modified:
llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp
llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll
llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp?rev=276298&r1=276297&r2=276298&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp Thu Jul 21 10:59:23 2016
@@ -24,7 +24,8 @@ MCSection *AMDGPUTargetObjectFile::Selec
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);
Modified: llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll?rev=276298&r1=276297&r2=276298&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll Thu Jul 21 10:59:23 2016
@@ -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) {
Modified: llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll?rev=276298&r1=276297&r2=276298&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll Thu Jul 21 10:59:23 2016
@@ -38,7 +38,7 @@ define void @test() {
; 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
More information about the llvm-commits
mailing list