mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
[AMDGPU] Emit read-only data to .rodata for hsa
Differential Revision: https://reviews.llvm.org/D22538 llvm-svn: 276298
This commit is contained in:
parent
3a4563a1e2
commit
b16afe7359
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user