From a6b9e2062315a84bdc3dee80781a804b4c4a740d Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 22 Jul 2016 23:46:40 +0000 Subject: [PATCH] Revert "[AMDGPU] Emit read-only data to .rodata for hsa" This reverts commit r276298. Data stored in .rodata can have a negative offset from .text, but we don't support negative values in relocations yet. This caused a regression in one of the amp conformance tests: 5_Data_Cont/5_2_a_v/5_2_3_m/Assignment/Test.02.01 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276498 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp | 3 +-- test/CodeGen/AMDGPU/global-constant.ll | 2 +- test/CodeGen/AMDGPU/hsa-globals.ll | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp b/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp index 02e9d1837e3..03d1e2c764d 100644 --- a/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp +++ b/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp @@ -24,8 +24,7 @@ MCSection *AMDGPUTargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler &Mang, const TargetMachine &TM) const { - if (Kind.isReadOnly() && AMDGPU::isReadOnlySegment(GV) && - TM.getTargetTriple().getOS() != Triple::AMDHSA) + if (Kind.isReadOnly() && AMDGPU::isReadOnlySegment(GV)) return TextSection; return TargetLoweringObjectFileELF::SelectSectionForGlobal(GV, Kind, Mang, TM); diff --git a/test/CodeGen/AMDGPU/global-constant.ll b/test/CodeGen/AMDGPU/global-constant.ll index 9eb5819bf6f..0f2fc836a24 100644 --- a/test/CodeGen/AMDGPU/global-constant.ll +++ b/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: .section .rodata +; HSA: .text ; GCN: readonly: ; GCN: readonly2: define void @main(i32 %index, float addrspace(1)* %out) { diff --git a/test/CodeGen/AMDGPU/hsa-globals.ll b/test/CodeGen/AMDGPU/hsa-globals.ll index 2820b308edb..df478fbcf3b 100644 --- a/test/CodeGen/AMDGPU/hsa-globals.ll +++ b/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: .section .rodata.cst4,"aM",@progbits,4 +; ASM: .text ; ASM: internal_readonly: ; ASM: .long 0 ; ASM: .size internal_readonly, 4