Skip to content

Commit 7bd1b39

Browse files
committed
Infer amdgpu-no-flat-scratch-init attribute in AMDGPUAttributor
The AMDGPUAnnotateKernelFeatures pass infers the "amdgpu-calls" and "amdgpu-stack-objects" attributes, which are used to infer whether we need to initialize flat scratch. This is, however, not precise. Instead, we should use AMDGPUAttributor and infer amdgpu-no-flat-scratch-init on kernels. Refer to #63586 .
1 parent 7d53730 commit 7bd1b39

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

llvm/test/CodeGen/AMDGPU/attributor-flatscratchinit-globalisel.ll

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -518,10 +518,11 @@ define amdgpu_kernel void @call_use_intrinsic_workitem_id_x_cc_kernel() {
518518
; GFX10: argumentInfo:
519519
; GFX10-NEXT: privateSegmentBuffer: { reg: '$sgpr0_sgpr1_sgpr2_sgpr3' }
520520
; GFX10-NEXT: dispatchPtr: { reg: '$sgpr4_sgpr5' }
521-
; GFX10-NEXT: kernargSegmentPtr: { reg: '$sgpr6_sgpr7' }
522-
; GFX10-NEXT: dispatchID: { reg: '$sgpr8_sgpr9' }
523-
; GFX10-NEXT: flatScratchInit: { reg: '$sgpr10_sgpr11' }
524-
; GFX10-NEXT: workGroupIDX: { reg: '$sgpr12' }
521+
; GFX10-NEXT: queuePtr: { reg: '$sgpr6_sgpr7' }
522+
; GFX10-NEXT: kernargSegmentPtr: { reg: '$sgpr8_sgpr9' }
523+
; GFX10-NEXT: dispatchID: { reg: '$sgpr10_sgpr11' }
524+
; GFX10-NEXT: flatScratchInit: { reg: '$sgpr12_sgpr13' }
525+
; GFX10-NEXT: workGroupIDX: { reg: '$sgpr14' }
525526
;
526527
; GFX10: name: call_with_indirect_call
527528
; GFX10: argumentInfo:
@@ -535,10 +536,12 @@ define amdgpu_kernel void @call_use_intrinsic_workitem_id_x_cc_kernel() {
535536
; GFX10: argumentInfo:
536537
; GFX10-NEXT: privateSegmentBuffer: { reg: '$sgpr0_sgpr1_sgpr2_sgpr3' }
537538
; GFX10-NEXT: dispatchPtr: { reg: '$sgpr4_sgpr5' }
538-
; GFX10-NEXT: kernargSegmentPtr: { reg: '$sgpr6_sgpr7' }
539-
; GFX10-NEXT: dispatchID: { reg: '$sgpr8_sgpr9' }
540-
; GFX10-NEXT: flatScratchInit: { reg: '$sgpr10_sgpr11' }
541-
; GFX10-NEXT: workGroupIDX: { reg: '$sgpr12' }
539+
; GFX10-NEXT: queuePtr: { reg: '$sgpr6_sgpr7' }
540+
; GFX10-NEXT: kernargSegmentPtr: { reg: '$sgpr8_sgpr9' }
541+
; GFX10-NEXT: dispatchID: { reg: '$sgpr10_sgpr11' }
542+
; GFX10-NEXT: flatScratchInit: { reg: '$sgpr12_sgpr13' }
543+
; GFX10-NEXT: workGroupIDX: { reg: '$sgpr14' }
544+
542545
;
543546
; GFX10: name: use_intrinsic_workitem_id_x
544547
; GFX10: argumentInfo:

0 commit comments

Comments
 (0)