Skip to content

Commit b629b86

Browse files
authored
[AMDGPU][MC] Use normal ELF syntax for section switching (#77267)
For some reasons `SunStyleELFSectionSwitchSyntax` is set to `true` for AMDGPU, but according to #64862 (comment) that syntax is only limited to Sun system. Fix #64862.
1 parent b565ee1 commit b629b86

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(const Triple &TT,
3131
InlineAsmEnd = ";#ASMEND";
3232

3333
//===--- Data Emission Directives -------------------------------------===//
34-
SunStyleELFSectionSwitchSyntax = true;
3534
UsesELFSectionDirectiveForBSS = true;
3635

3736
//===--- Global Variable Emission Directives --------------------------===//

llvm/test/CodeGen/AMDGPU/code-object-v3.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
; OSABI-AMDHSA-ASM-NOT: .amd_kernel_code_t
1010

1111
; OSABI-AMDHSA-ASM: s_endpgm
12-
; OSABI-AMDHSA-ASM: .section .rodata,#alloc
12+
; OSABI-AMDHSA-ASM: .section .rodata,"a"
1313
; OSABI-AMDHSA-ASM: .p2align 6
1414
; OSABI-AMDHSA-ASM: .amdhsa_kernel fadd
1515
; OSABI-AMDHSA-ASM: .amdhsa_user_sgpr_count 6
@@ -28,7 +28,7 @@
2828
; OSABI-AMDHSA-ASM-NOT: .amd_kernel_code_t
2929

3030
; OSABI-AMDHSA-ASM: s_endpgm
31-
; OSABI-AMDHSA-ASM: .section .rodata,#alloc
31+
; OSABI-AMDHSA-ASM: .section .rodata,"a"
3232
; OSABI-AMDHSA-ASM: .p2align 6
3333
; OSABI-AMDHSA-ASM: .amdhsa_kernel fsub
3434
; OSABI-AMDHSA-ASM: .amdhsa_user_sgpr_count 6

llvm/test/CodeGen/AMDGPU/hsa-globals.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ define amdgpu_kernel void @test() {
1616
@weak_global = extern_weak addrspace(1) global i32
1717

1818
; ASM: .type linkonce_odr_global_program,@object
19-
; ASM: .section .bss,#alloc,#write
19+
; ASM: .section .bss,"aw"
2020
; ASM: .weak linkonce_odr_global_program
2121
; ASM: linkonce_odr_global_program:
2222
; ASM: .long 0

llvm/test/CodeGen/AMDGPU/lower-module-lds-via-hybrid.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memo
305305

306306
; Table size length number-kernels * number-variables * sizeof(uint16_t)
307307
; GCN: .type llvm.amdgcn.lds.offset.table,@object
308-
; GCN-NEXT: .section .data.rel.ro,#alloc,#write
308+
; GCN-NEXT: .section .data.rel.ro,"aw"
309309
; GCN-NEXT: .p2align 2, 0x0
310310
; GCN-NEXT: llvm.amdgcn.lds.offset.table:
311311
; GCN-NEXT: .long 8

llvm/test/CodeGen/AMDGPU/lower-module-lds-via-table.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ define amdgpu_kernel void @k123() {
355355

356356
; Table size length number-kernels * number-variables * sizeof(uint16_t)
357357
; GCN: .type llvm.amdgcn.lds.offset.table,@object
358-
; GCN-NEXT: .section .data.rel.ro,#alloc,#write
358+
; GCN-NEXT: .section .data.rel.ro,"aw"
359359
; GCN-NEXT: .p2align 4, 0x0
360360
; GCN-NEXT: llvm.amdgcn.lds.offset.table:
361361
; GCN-NEXT: .long 0+4

llvm/test/CodeGen/AMDGPU/stack-realign-kernel.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ define amdgpu_kernel void @max_alignment_128() #0 {
1212
; VI-NEXT: buffer_store_dword v0, off, s[0:3], 0 offset:128
1313
; VI-NEXT: s_waitcnt vmcnt(0)
1414
; VI-NEXT: s_endpgm
15-
; VI-NEXT: .section .rodata,#alloc
15+
; VI-NEXT: .section .rodata,"a"
1616
; VI-NEXT: .p2align 6
1717
; VI-NEXT: .amdhsa_kernel max_alignment_128
1818
; VI-NEXT: .amdhsa_group_segment_fixed_size 0
@@ -60,7 +60,7 @@ define amdgpu_kernel void @max_alignment_128() #0 {
6060
; GFX9-NEXT: buffer_store_dword v0, off, s[0:3], 0 offset:128
6161
; GFX9-NEXT: s_waitcnt vmcnt(0)
6262
; GFX9-NEXT: s_endpgm
63-
; GFX9-NEXT: .section .rodata,#alloc
63+
; GFX9-NEXT: .section .rodata,"a"
6464
; GFX9-NEXT: .p2align 6
6565
; GFX9-NEXT: .amdhsa_kernel max_alignment_128
6666
; GFX9-NEXT: .amdhsa_group_segment_fixed_size 0
@@ -115,7 +115,7 @@ define amdgpu_kernel void @stackrealign_attr() #1 {
115115
; VI-NEXT: buffer_store_dword v0, off, s[0:3], 0 offset:4
116116
; VI-NEXT: s_waitcnt vmcnt(0)
117117
; VI-NEXT: s_endpgm
118-
; VI-NEXT: .section .rodata,#alloc
118+
; VI-NEXT: .section .rodata,"a"
119119
; VI-NEXT: .p2align 6
120120
; VI-NEXT: .amdhsa_kernel stackrealign_attr
121121
; VI-NEXT: .amdhsa_group_segment_fixed_size 0
@@ -163,7 +163,7 @@ define amdgpu_kernel void @stackrealign_attr() #1 {
163163
; GFX9-NEXT: buffer_store_dword v0, off, s[0:3], 0 offset:4
164164
; GFX9-NEXT: s_waitcnt vmcnt(0)
165165
; GFX9-NEXT: s_endpgm
166-
; GFX9-NEXT: .section .rodata,#alloc
166+
; GFX9-NEXT: .section .rodata,"a"
167167
; GFX9-NEXT: .p2align 6
168168
; GFX9-NEXT: .amdhsa_kernel stackrealign_attr
169169
; GFX9-NEXT: .amdhsa_group_segment_fixed_size 0
@@ -218,7 +218,7 @@ define amdgpu_kernel void @alignstack_attr() #2 {
218218
; VI-NEXT: buffer_store_dword v0, off, s[0:3], 0 offset:4
219219
; VI-NEXT: s_waitcnt vmcnt(0)
220220
; VI-NEXT: s_endpgm
221-
; VI-NEXT: .section .rodata,#alloc
221+
; VI-NEXT: .section .rodata,"a"
222222
; VI-NEXT: .p2align 6
223223
; VI-NEXT: .amdhsa_kernel alignstack_attr
224224
; VI-NEXT: .amdhsa_group_segment_fixed_size 0
@@ -266,7 +266,7 @@ define amdgpu_kernel void @alignstack_attr() #2 {
266266
; GFX9-NEXT: buffer_store_dword v0, off, s[0:3], 0 offset:4
267267
; GFX9-NEXT: s_waitcnt vmcnt(0)
268268
; GFX9-NEXT: s_endpgm
269-
; GFX9-NEXT: .section .rodata,#alloc
269+
; GFX9-NEXT: .section .rodata,"a"
270270
; GFX9-NEXT: .p2align 6
271271
; GFX9-NEXT: .amdhsa_kernel alignstack_attr
272272
; GFX9-NEXT: .amdhsa_group_segment_fixed_size 0

0 commit comments

Comments
 (0)