-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AMDGPU: Handle gfx950 global_load_lds_* instructions #116680
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
137 changes: 137 additions & 0 deletions
137
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.global.load.lds.gfx950.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,137 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4 | ||
; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx950 < %s | FileCheck -check-prefixes=GFX950,GFX950-SDAG %s | ||
; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx950 < %s | FileCheck -check-prefixes=GFX950,GFX950-GISEL %s | ||
|
||
declare void @llvm.amdgcn.global.load.lds(ptr addrspace(1) nocapture %gptr, ptr addrspace(3) nocapture %lptr, i32 %size, i32 %offset, i32 %aux) | ||
|
||
;---------------------------------------------------------------------y | ||
; dwordx3 | ||
;--------------------------------------------------------------------- | ||
|
||
define amdgpu_ps void @global_load_lds_dwordx3_vaddr(ptr addrspace(1) nocapture %gptr, ptr addrspace(3) nocapture %lptr) { | ||
; GFX950-SDAG-LABEL: global_load_lds_dwordx3_vaddr: | ||
; GFX950-SDAG: ; %bb.0: | ||
; GFX950-SDAG-NEXT: v_readfirstlane_b32 s0, v2 | ||
; GFX950-SDAG-NEXT: s_mov_b32 m0, s0 | ||
; GFX950-SDAG-NEXT: s_nop 0 | ||
; GFX950-SDAG-NEXT: global_load_lds_dwordx3 v[0:1], off offset:16 sc0 | ||
; GFX950-SDAG-NEXT: s_endpgm | ||
; | ||
; GFX950-GISEL-LABEL: global_load_lds_dwordx3_vaddr: | ||
; GFX950-GISEL: ; %bb.0: | ||
; GFX950-GISEL-NEXT: v_readfirstlane_b32 m0, v2 | ||
; GFX950-GISEL-NEXT: s_nop 4 | ||
; GFX950-GISEL-NEXT: global_load_lds_dwordx3 v[0:1], off offset:16 sc0 | ||
; GFX950-GISEL-NEXT: s_endpgm | ||
call void @llvm.amdgcn.global.load.lds(ptr addrspace(1) %gptr, ptr addrspace(3) %lptr, i32 12, i32 16, i32 1) | ||
ret void | ||
} | ||
|
||
define amdgpu_ps void @global_load_lds_dwordx3_saddr(ptr addrspace(1) nocapture inreg %gptr, ptr addrspace(3) nocapture %lptr) { | ||
; GFX950-SDAG-LABEL: global_load_lds_dwordx3_saddr: | ||
; GFX950-SDAG: ; %bb.0: | ||
; GFX950-SDAG-NEXT: v_readfirstlane_b32 s2, v0 | ||
; GFX950-SDAG-NEXT: v_mov_b32_e32 v1, 0 | ||
; GFX950-SDAG-NEXT: s_mov_b32 m0, s2 | ||
; GFX950-SDAG-NEXT: s_nop 0 | ||
; GFX950-SDAG-NEXT: global_load_lds_dwordx3 v1, s[0:1] offset:32 nt | ||
; GFX950-SDAG-NEXT: s_endpgm | ||
; | ||
; GFX950-GISEL-LABEL: global_load_lds_dwordx3_saddr: | ||
; GFX950-GISEL: ; %bb.0: | ||
; GFX950-GISEL-NEXT: v_readfirstlane_b32 m0, v0 | ||
; GFX950-GISEL-NEXT: v_mov_b32_e32 v0, 0 | ||
; GFX950-GISEL-NEXT: s_nop 3 | ||
; GFX950-GISEL-NEXT: global_load_lds_dwordx3 v0, s[0:1] offset:32 nt | ||
; GFX950-GISEL-NEXT: s_endpgm | ||
call void @llvm.amdgcn.global.load.lds(ptr addrspace(1) %gptr, ptr addrspace(3) %lptr, i32 12, i32 32, i32 2) | ||
ret void | ||
} | ||
|
||
define amdgpu_ps void @global_load_lds_dwordx3_saddr_and_vaddr(ptr addrspace(1) nocapture inreg %gptr, ptr addrspace(3) nocapture %lptr, i32 %voffset) { | ||
; GFX950-SDAG-LABEL: global_load_lds_dwordx3_saddr_and_vaddr: | ||
; GFX950-SDAG: ; %bb.0: | ||
; GFX950-SDAG-NEXT: v_readfirstlane_b32 s2, v0 | ||
; GFX950-SDAG-NEXT: s_mov_b32 m0, s2 | ||
; GFX950-SDAG-NEXT: s_nop 0 | ||
; GFX950-SDAG-NEXT: global_load_lds_dwordx3 v1, s[0:1] offset:48 sc1 | ||
; GFX950-SDAG-NEXT: s_endpgm | ||
; | ||
; GFX950-GISEL-LABEL: global_load_lds_dwordx3_saddr_and_vaddr: | ||
; GFX950-GISEL: ; %bb.0: | ||
; GFX950-GISEL-NEXT: v_readfirstlane_b32 m0, v0 | ||
; GFX950-GISEL-NEXT: s_nop 4 | ||
; GFX950-GISEL-NEXT: global_load_lds_dwordx3 v1, s[0:1] offset:48 sc1 | ||
; GFX950-GISEL-NEXT: s_endpgm | ||
%voffset.64 = zext i32 %voffset to i64 | ||
%gep = getelementptr i8, ptr addrspace(1) %gptr, i64 %voffset.64 | ||
call void @llvm.amdgcn.global.load.lds(ptr addrspace(1) %gep, ptr addrspace(3) %lptr, i32 12, i32 48, i32 16) | ||
ret void | ||
} | ||
|
||
;--------------------------------------------------------------------- | ||
; dwordx4 | ||
;--------------------------------------------------------------------- | ||
|
||
define amdgpu_ps void @global_load_lds_dwordx4_vaddr(ptr addrspace(1) nocapture %gptr, ptr addrspace(3) nocapture %lptr) { | ||
; GFX950-SDAG-LABEL: global_load_lds_dwordx4_vaddr: | ||
; GFX950-SDAG: ; %bb.0: | ||
; GFX950-SDAG-NEXT: v_readfirstlane_b32 s0, v2 | ||
; GFX950-SDAG-NEXT: s_mov_b32 m0, s0 | ||
; GFX950-SDAG-NEXT: s_nop 0 | ||
; GFX950-SDAG-NEXT: global_load_lds_dwordx4 v[0:1], off offset:16 sc0 | ||
; GFX950-SDAG-NEXT: s_endpgm | ||
; | ||
; GFX950-GISEL-LABEL: global_load_lds_dwordx4_vaddr: | ||
; GFX950-GISEL: ; %bb.0: | ||
; GFX950-GISEL-NEXT: v_readfirstlane_b32 m0, v2 | ||
; GFX950-GISEL-NEXT: s_nop 4 | ||
; GFX950-GISEL-NEXT: global_load_lds_dwordx4 v[0:1], off offset:16 sc0 | ||
; GFX950-GISEL-NEXT: s_endpgm | ||
call void @llvm.amdgcn.global.load.lds(ptr addrspace(1) %gptr, ptr addrspace(3) %lptr, i32 16, i32 16, i32 1) | ||
ret void | ||
} | ||
|
||
define amdgpu_ps void @global_load_lds_dwordx4_saddr(ptr addrspace(1) nocapture inreg %gptr, ptr addrspace(3) nocapture %lptr) { | ||
; GFX950-SDAG-LABEL: global_load_lds_dwordx4_saddr: | ||
; GFX950-SDAG: ; %bb.0: | ||
; GFX950-SDAG-NEXT: v_readfirstlane_b32 s2, v0 | ||
; GFX950-SDAG-NEXT: v_mov_b32_e32 v1, 0 | ||
; GFX950-SDAG-NEXT: s_mov_b32 m0, s2 | ||
; GFX950-SDAG-NEXT: s_nop 0 | ||
; GFX950-SDAG-NEXT: global_load_lds_dwordx4 v1, s[0:1] offset:32 nt | ||
; GFX950-SDAG-NEXT: s_endpgm | ||
; | ||
; GFX950-GISEL-LABEL: global_load_lds_dwordx4_saddr: | ||
; GFX950-GISEL: ; %bb.0: | ||
; GFX950-GISEL-NEXT: v_readfirstlane_b32 m0, v0 | ||
; GFX950-GISEL-NEXT: v_mov_b32_e32 v0, 0 | ||
; GFX950-GISEL-NEXT: s_nop 3 | ||
; GFX950-GISEL-NEXT: global_load_lds_dwordx4 v0, s[0:1] offset:32 nt | ||
; GFX950-GISEL-NEXT: s_endpgm | ||
call void @llvm.amdgcn.global.load.lds(ptr addrspace(1) %gptr, ptr addrspace(3) %lptr, i32 16, i32 32, i32 2) | ||
ret void | ||
} | ||
|
||
define amdgpu_ps void @global_load_lds_dwordx4_saddr_and_vaddr(ptr addrspace(1) nocapture inreg %gptr, ptr addrspace(3) nocapture %lptr, i32 %voffset) { | ||
; GFX950-SDAG-LABEL: global_load_lds_dwordx4_saddr_and_vaddr: | ||
; GFX950-SDAG: ; %bb.0: | ||
; GFX950-SDAG-NEXT: v_readfirstlane_b32 s2, v0 | ||
; GFX950-SDAG-NEXT: s_mov_b32 m0, s2 | ||
; GFX950-SDAG-NEXT: s_nop 0 | ||
; GFX950-SDAG-NEXT: global_load_lds_dwordx4 v1, s[0:1] offset:48 sc1 | ||
; GFX950-SDAG-NEXT: s_endpgm | ||
; | ||
; GFX950-GISEL-LABEL: global_load_lds_dwordx4_saddr_and_vaddr: | ||
; GFX950-GISEL: ; %bb.0: | ||
; GFX950-GISEL-NEXT: v_readfirstlane_b32 m0, v0 | ||
; GFX950-GISEL-NEXT: s_nop 4 | ||
; GFX950-GISEL-NEXT: global_load_lds_dwordx4 v1, s[0:1] offset:48 sc1 | ||
; GFX950-GISEL-NEXT: s_endpgm | ||
%voffset.64 = zext i32 %voffset to i64 | ||
%gep = getelementptr i8, ptr addrspace(1) %gptr, i64 %voffset.64 | ||
call void @llvm.amdgcn.global.load.lds(ptr addrspace(1) %gep, ptr addrspace(3) %lptr, i32 16, i32 48, i32 16) | ||
ret void | ||
} | ||
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: | ||
; GFX950: {{.*}} |
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,37 @@ | ||
// RUN: llvm-mc -triple=amdgcn -mcpu=gfx950 -show-encoding %s | FileCheck --check-prefix=GFX950 --strict-whitespace %s | ||
// xUN: not llvm-mc -triple=amdgcn -mcpu=gfx940 %s 2>&1 | FileCheck --check-prefixes=NOT-GFX950,GFX940 --implicit-check-not=error: %s | ||
// xUN: not llvm-mc -triple=amdgcn -mcpu=gfx90a %s 2>&1 | FileCheck --check-prefixes=NOT-GFX950,GFX90A --implicit-check-not=error: %s | ||
// xUN: not llvm-mc -triple=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefixes=NOT-GFX950,GFX10 --implicit-check-not=error: %s | ||
|
||
// NOT-GFX950: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU | ||
// GFX950: global_load_lds_dwordx3 v[2:3], off ; encoding: [0x00,0x80,0xf8,0xdd,0x02,0x00,0x7f,0x00] | ||
|
||
global_load_lds_dwordx3 v[2:3], off | ||
|
||
// NOT-GFX950: :[[@LINE+2]]:{{[0-9]+}}: error: | ||
// GFX950: global_load_lds_dwordx3 v[2:3], off sc0 nt sc1 ; encoding: [0x00,0x80,0xfb,0xdf,0x02,0x00,0x7f,0x00] | ||
global_load_lds_dwordx3 v[2:3], off sc0 nt sc1 | ||
|
||
// NOT-GFX950: :[[@LINE+2]]:{{[0-9]+}}: error: | ||
// GFX950: global_load_lds_dwordx3 v[2:3], off offset:4 ; encoding: [0x04,0x80,0xf8,0xdd,0x02,0x00,0x7f,0x00] | ||
global_load_lds_dwordx3 v[2:3], off offset:4 | ||
|
||
// NOT-GFX950: :[[@LINE+2]]:{{[0-9]+}}: error: | ||
// GFX950: global_load_lds_dwordx3 v2, s[4:5] offset:4 ; encoding: [0x04,0x80,0xf8,0xdd,0x02,0x00,0x04,0x00] | ||
global_load_lds_dwordx3 v2, s[4:5] offset:4 | ||
|
||
// NOT-GFX950: :[[@LINE+2]]:{{[0-9]+}}: error: instruction not supported on this GPU | ||
// GFX950: global_load_lds_dwordx4 v[2:3], off ; encoding: [0x00,0x80,0xf4,0xdd,0x02,0x00,0x7f,0x00] | ||
global_load_lds_dwordx4 v[2:3], off | ||
|
||
// NOT-GFX950: :[[@LINE+2]]:{{[0-9]+}}: error: | ||
// GFX950: global_load_lds_dwordx4 v[2:3], off sc0 nt sc1 ; encoding: [0x00,0x80,0xf7,0xdf,0x02,0x00,0x7f,0x00] | ||
global_load_lds_dwordx4 v[2:3], off sc0 nt sc1 | ||
|
||
// NOT-GFX950: :[[@LINE+2]]:{{[0-9]+}}: error: | ||
// GFX950: global_load_lds_dwordx4 v[2:3], off offset:4 ; encoding: [0x04,0x80,0xf4,0xdd,0x02,0x00,0x7f,0x00] | ||
global_load_lds_dwordx4 v[2:3], off offset:4 | ||
|
||
// NOT-GFX950: :[[@LINE+2]]:{{[0-9]+}}: error: | ||
// GFX950: global_load_lds_dwordx4 v2, s[4:5] offset:4 ; encoding: [0x04,0x80,0xf4,0xdd,0x02,0x00,0x04,0x00] | ||
global_load_lds_dwordx4 v2, s[4:5] offset:4 |
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,25 @@ | ||
# RUN: llvm-mc -triple=amdgcn -mcpu=gfx950 -show-encoding -disassemble %s | FileCheck -check-prefix=GFX950 %s | ||
|
||
# GFX950: global_load_lds_dwordx3 v2, s[4:5] offset:4 ; encoding: [0x04,0x80,0xf8,0xdd,0x02,0x00,0x04,0x00] | ||
0x04,0x80,0xf8,0xdd,0x02,0x00,0x04,0x00 | ||
|
||
# GFX950: global_load_lds_dwordx3 v[2:3], off ; encoding: [0x00,0x80,0xf8,0xdd,0x02,0x00,0x7f,0x00] | ||
0x00,0x80,0xf8,0xdd,0x02,0x00,0x7f,0x00 | ||
|
||
# GFX950: global_load_lds_dwordx3 v[2:3], off offset:4 ; encoding: [0x04,0x80,0xf8,0xdd,0x02,0x00,0x7f,0x00] | ||
0x04,0x80,0xf8,0xdd,0x02,0x00,0x7f,0x00 | ||
|
||
# GFX950: global_load_lds_dwordx3 v[2:3], off sc0 nt sc1 ; encoding: [0x00,0x80,0xfb,0xdf,0x02,0x00,0x7f,0x00] | ||
0x00,0x80,0xfb,0xdf,0x02,0x00,0x7f,0x00 | ||
|
||
# GFX950: global_load_lds_dwordx4 v2, s[4:5] offset:4 ; encoding: [0x04,0x80,0xf4,0xdd,0x02,0x00,0x04,0x00] | ||
0x04,0x80,0xf4,0xdd,0x02,0x00,0x04,0x00 | ||
|
||
# GFX950: global_load_lds_dwordx4 v[2:3], off ; encoding: [0x00,0x80,0xf4,0xdd,0x02,0x00,0x7f,0x00] | ||
0x00,0x80,0xf4,0xdd,0x02,0x00,0x7f,0x00 | ||
|
||
# GFX950: global_load_lds_dwordx4 v[2:3], off offset:4 ; encoding: [0x04,0x80,0xf4,0xdd,0x02,0x00,0x7f,0x00] | ||
0x04,0x80,0xf4,0xdd,0x02,0x00,0x7f,0x00 | ||
|
||
# GFX950: global_load_lds_dwordx4 v[2:3], off sc0 nt sc1 ; encoding: [0x00,0x80,0xf7,0xdf,0x02,0x00,0x7f,0x00] | ||
0x00,0x80,0xf7,0xdf,0x02,0x00,0x7f,0x00 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why two blank lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whatever was in the merge