summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp3
-rw-r--r--llvm/test/CodeGen/AMDGPU/global-constant.ll2
-rw-r--r--llvm/test/CodeGen/AMDGPU/hsa-globals.ll2
3 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp
index 03d1e2c764d..02e9d1837e3 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp
@@ -24,7 +24,8 @@ MCSection *AMDGPUTargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
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);
diff --git a/llvm/test/CodeGen/AMDGPU/global-constant.ll b/llvm/test/CodeGen/AMDGPU/global-constant.ll
index 0f2fc836a24..9eb5819bf6f 100644
--- a/llvm/test/CodeGen/AMDGPU/global-constant.ll
+++ b/llvm/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) {
diff --git a/llvm/test/CodeGen/AMDGPU/hsa-globals.ll b/llvm/test/CodeGen/AMDGPU/hsa-globals.ll
index df478fbcf3b..2820b308edb 100644
--- a/llvm/test/CodeGen/AMDGPU/hsa-globals.ll
+++ b/llvm/test/CodeGen/AMDGPU/hsa-globals.ll
@@ -38,7 +38,7 @@ define void @test() {
; ASM: .size external_global_program, 4
; ASM: .type internal_readonly,@object
-; ASM: .text
+; ASM: .section .rodata.cst4,"aM",@progbits,4
; ASM: internal_readonly:
; ASM: .long 0
; ASM: .size internal_readonly, 4
OpenPOWER on IntegriCloud