Skip to content

Commit

Permalink
[AMDGPU] Precommit test for D79481. NFC
Browse files Browse the repository at this point in the history
Test shows unnecessary s_waitcnt between shader exports.
  • Loading branch information
perlfu committed May 7, 2020
1 parent f649aca commit 0d4d86c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions llvm/test/CodeGen/AMDGPU/llvm.amdgcn.exp.ll
Expand Up @@ -540,5 +540,23 @@ end:
ret void
}

; GCN-LABEL: {{^}}test_export_clustering:
; GCN-DAG: v_mov_b32_e32 [[W0:v[0-9]+]], 0
; GCN-DAG: v_mov_b32_e32 [[X:v[0-9]+]], s0
; GCN-DAG: v_mov_b32_e32 [[Y:v[0-9]+]], s1
; GCN-DAG: v_add_f32_e32 [[Z0:v[0-9]+]]
; GCN-DAG: exp param0 [[X]], [[Y]], [[Z0]], [[W0]]{{$}}
; GCN-DAG: v_sub_f32_e32 [[Z1:v[0-9]+]]
; GCN: s_waitcnt expcnt(0)
; GCN: v_mov_b32_e32 [[W1:v[0-9]+]], 1.0
; GCN: exp param1 [[X]], [[Y]], [[Z1]], [[W1]] done{{$}}
define amdgpu_kernel void @test_export_clustering(float %x, float %y) #0 {
%z0 = fadd float %x, %y
call void @llvm.amdgcn.exp.f32(i32 32, i32 15, float %x, float %y, float %z0, float 0.0, i1 false, i1 false)
%z1 = fsub float %y, %x
call void @llvm.amdgcn.exp.f32(i32 33, i32 15, float %x, float %y, float %z1, float 1.0, i1 true, i1 false)
ret void
}

attributes #0 = { nounwind }
attributes #1 = { nounwind inaccessiblememonly }

0 comments on commit 0d4d86c

Please sign in to comment.