Skip to content

Commit 793b4b2

Browse files
committed
Revert "AMDGPU: Correct const_index_stride for wave 32 for PAL ABI"
This reverts commit 442de0c.
1 parent 2a3f60b commit 793b4b2

File tree

2 files changed

+2
-35
lines changed

2 files changed

+2
-35
lines changed

llvm/lib/Target/AMDGPU/SIFrameLowering.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,6 @@ void SIFrameLowering::emitEntryFunctionScratchRsrcRegSetup(
525525
// The pointer to the GIT is formed from the offset passed in and either
526526
// the amdgpu-git-ptr-high function attribute or the top part of the PC
527527
Register Rsrc01 = TRI->getSubReg(ScratchRsrcReg, AMDGPU::sub0_sub1);
528-
Register Rsrc03 = TRI->getSubReg(ScratchRsrcReg, AMDGPU::sub3);
529528

530529
buildGitPtr(MBB, I, DL, TII, Rsrc01);
531530

@@ -547,20 +546,6 @@ void SIFrameLowering::emitEntryFunctionScratchRsrcRegSetup(
547546
.addImm(0) // cpol
548547
.addReg(ScratchRsrcReg, RegState::ImplicitDefine)
549548
.addMemOperand(MMO);
550-
551-
// The driver will always set the SRD for wave 64 (bits 118:117 of
552-
// descriptor / bits 22:21 of third sub-reg will be 0b11)
553-
// If the shader is actually wave32 we have to modify the const_index_stride
554-
// field of the descriptor 3rd sub-reg (bits 22:21) to 0b10 (stride=32). The
555-
// reason the driver does this is that there can be cases where it presents
556-
// 2 shaders with different wave size (e.g. VsFs).
557-
// TODO: convert to using SCRATCH instructions or multiple SRD buffers
558-
if (ST.isWave32()) {
559-
const MCInstrDesc &SBitsetB32 = TII->get(AMDGPU::S_BITSET0_B32);
560-
BuildMI(MBB, I, DL, SBitsetB32, Rsrc03)
561-
.addImm(21)
562-
.addReg(Rsrc03, RegState::ImplicitDefine);
563-
}
564549
} else if (ST.isMesaGfxShader(Fn) || !PreloadedScratchRsrcReg) {
565550
assert(!ST.isAmdHsaOrMesa(Fn));
566551
const MCInstrDesc &SMovB32 = TII->get(AMDGPU::S_MOV_B32);

llvm/test/CodeGen/AMDGPU/pal-simple-indirect-call.ll

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
; RUN: opt -S -mtriple=amdgcn-amd-amdpal -amdgpu-annotate-kernel-features %s | FileCheck -check-prefix=GCN %s
44

55
; Check that it doesn't crash
6-
; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx900 < %s | FileCheck -check-prefixes=GFX9 %s
7-
; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1010 < %s | FileCheck -check-prefixes=GFX10 %s
6+
; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1010 < %s | FileCheck -check-prefix=GFX9 %s
87

98
target datalayout = "A5"
109

@@ -14,8 +13,8 @@ define amdgpu_cs void @test_simple_indirect_call() {
1413
; GFX9: ; %bb.0:
1514
; GFX9-NEXT: s_getpc_b64 s[36:37]
1615
; GFX9-NEXT: s_mov_b32 s36, s0
17-
; GFX9-NEXT: s_load_dwordx4 s[36:39], s[36:37], 0x10
1816
; GFX9-NEXT: s_getpc_b64 s[4:5]
17+
; GFX9-NEXT: s_load_dwordx4 s[36:39], s[36:37], 0x10
1918
; GFX9-NEXT: s_mov_b32 s32, 0
2019
; GFX9-NEXT: s_waitcnt lgkmcnt(0)
2120
; GFX9-NEXT: s_add_u32 s36, s36, s0
@@ -24,23 +23,6 @@ define amdgpu_cs void @test_simple_indirect_call() {
2423
; GFX9-NEXT: s_mov_b64 s[2:3], s[38:39]
2524
; GFX9-NEXT: s_swappc_b64 s[30:31], s[4:5]
2625
; GFX9-NEXT: s_endpgm
27-
;
28-
; GFX10-LABEL: test_simple_indirect_call:
29-
; GFX10: ; %bb.0:
30-
; GFX10-NEXT: s_getpc_b64 s[36:37]
31-
; GFX10-NEXT: s_mov_b32 s36, s0
32-
; GFX10-NEXT: s_getpc_b64 s[4:5]
33-
; GFX10-NEXT: s_load_dwordx4 s[36:39], s[36:37], 0x10
34-
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
35-
; GFX10-NEXT: s_bitset0_b32 s39, 21
36-
; GFX10-NEXT: s_mov_b32 s32, 0
37-
; GFX10-NEXT: s_add_u32 s36, s36, s0
38-
; GFX10-NEXT: s_addc_u32 s37, s37, 0
39-
; GFX10-NEXT: s_mov_b64 s[0:1], s[36:37]
40-
; GFX10-NEXT: s_mov_b64 s[2:3], s[38:39]
41-
; GFX10-NEXT: s_swappc_b64 s[30:31], s[4:5]
42-
; GFX10-NEXT: s_endpgm
43-
4426

4527
%pc = call i64 @llvm.amdgcn.s.getpc()
4628
%fun = inttoptr i64 %pc to void()*

0 commit comments

Comments
 (0)