-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AMDGPU] New intrinsic llvm.amdgcn.pops.exiting.wave.id
This provides access to the special scalar source value SRC_POPS_EXITING_WAVE_ID on GFX9 and GFX10.
- Loading branch information
Showing
4 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.pops.exiting.wave.id.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4 | ||
; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck %s -check-prefix=SDAG | ||
; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck %s -check-prefix=GFX9-GISEL | ||
; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1010 < %s | FileCheck %s -check-prefix=SDAG | ||
; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1010 < %s | FileCheck %s -check-prefix=GFX10-GISEL | ||
|
||
define amdgpu_ps void @test(ptr addrspace(1) inreg %ptr) { | ||
; SDAG-LABEL: test: | ||
; SDAG: ; %bb.0: | ||
; SDAG-NEXT: s_mov_b32 s2, src_pops_exiting_wave_id | ||
; SDAG-NEXT: v_mov_b32_e32 v0, 0 | ||
; SDAG-NEXT: v_mov_b32_e32 v1, s2 | ||
; SDAG-NEXT: global_store_dword v0, v1, s[0:1] | ||
; SDAG-NEXT: s_endpgm | ||
; | ||
; GFX9-GISEL-LABEL: test: | ||
; GFX9-GISEL: ; %bb.0: | ||
; GFX9-GISEL-NEXT: s_mov_b32 s2, src_pops_exiting_wave_id | ||
; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s2 | ||
; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, 0 | ||
; GFX9-GISEL-NEXT: global_store_dword v1, v0, s[0:1] | ||
; GFX9-GISEL-NEXT: s_endpgm | ||
; | ||
; GFX10-GISEL-LABEL: test: | ||
; GFX10-GISEL: ; %bb.0: | ||
; GFX10-GISEL-NEXT: s_mov_b32 s2, src_pops_exiting_wave_id | ||
; GFX10-GISEL-NEXT: v_mov_b32_e32 v1, 0 | ||
; GFX10-GISEL-NEXT: v_mov_b32_e32 v0, s2 | ||
; GFX10-GISEL-NEXT: global_store_dword v1, v0, s[0:1] | ||
; GFX10-GISEL-NEXT: s_endpgm | ||
%id = call i32 @llvm.amdgcn.pops.exiting.wave.id() | ||
store i32 %id, ptr addrspace(1) %ptr | ||
ret void | ||
} |