Skip to content

Commit

Permalink
Update lgc test due to -mcpu upgrading to gfx1010
Browse files Browse the repository at this point in the history
- Upgrade `gpuName` default value from gfx802 to gfx1010.
- Update lgc test with -mcpu=gfx1010.
(cherry picked from commit 671d1d1d4024ff41edbcfe535aa28d77fefd45e3)
  • Loading branch information
xuechen417 committed Oct 23, 2023
1 parent b10cb3d commit 4483b12
Show file tree
Hide file tree
Showing 16 changed files with 146 additions and 102 deletions.
4 changes: 2 additions & 2 deletions lgc/test/BuiltIns/cs-deviceindex.lgc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by tool/update_llpc_test_checks.py UTC_ARGS: --tool lgc
; RUN: lgc -mcpu=gfx802 - < %s | FileCheck --check-prefixes=CHECK %s
; RUN: lgc -mcpu=gfx1010 - < %s | FileCheck --check-prefixes=CHECK %s

define dllexport spir_func void @lgc.shader.CS.main() local_unnamed_addr #0 !lgc.shaderstage !0 {
.entry:
Expand Down Expand Up @@ -31,8 +31,8 @@ attributes #0 = { nounwind }
; CHECK: s_getpc_b64 s[2:3]
; CHECK-NEXT: s_mov_b32 s0, s1
; CHECK-NEXT: s_mov_b32 s1, s3
; CHECK-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x0
; CHECK-NEXT: v_mov_b32_e32 v0, 0xbc614e
; CHECK-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x0
; CHECK-NEXT: s_waitcnt lgkmcnt(0)
; CHECK-NEXT: buffer_store_dword v0, off, s[0:3], 0
; CHECK-NEXT: s_endpgm
2 changes: 1 addition & 1 deletion lgc/test/BuiltIns/cs-globalinvocationid.lgc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by tool/update_llpc_test_checks.py UTC_ARGS: --tool lgc
; RUN: lgc -mcpu=gfx802 - < %s | FileCheck --check-prefixes=GFX8 %s
; RUN: lgc -mcpu=gfx1010 - < %s | FileCheck --check-prefixes=GFX8 %s
; RUN: lgc -mcpu=gfx1100 - < %s | FileCheck --check-prefixes=GFX11 %s
; REQUIRES: do-not-run-me

Expand Down
2 changes: 1 addition & 1 deletion lgc/test/BuiltIns/cs-localinvocationid.lgc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by tool/update_llpc_test_checks.py UTC_ARGS: --tool lgc
; RUN: lgc -mcpu=gfx802 - < %s | FileCheck --check-prefixes=GFX8 %s
; RUN: lgc -mcpu=gfx1010 - < %s | FileCheck --check-prefixes=GFX8 %s
; RUN: lgc -mcpu=gfx1100 - < %s | FileCheck --check-prefixes=GFX11 %s
; REQUIRES: do-not-run-me

Expand Down
2 changes: 1 addition & 1 deletion lgc/test/BuiltIns/cs-localinvocationindex.lgc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by tool/update_llpc_test_checks.py UTC_ARGS: --tool lgc
; RUN: lgc -mcpu=gfx802 - < %s | FileCheck --check-prefixes=GFX8 %s
; RUN: lgc -mcpu=gfx1010 - < %s | FileCheck --check-prefixes=GFX8 %s
; RUN: lgc -mcpu=gfx1100 - < %s | FileCheck --check-prefixes=GFX11 %s
; REQUIRES: do-not-run-me

Expand Down
4 changes: 2 additions & 2 deletions lgc/test/BuiltIns/cs-numsubgroups.lgc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by tool/update_llpc_test_checks.py UTC_ARGS: --tool lgc
; RUN: lgc -mcpu=gfx802 - < %s | FileCheck --check-prefixes=WAVE64 %s
; RUN: lgc -mcpu=gfx1010 - < %s | FileCheck --check-prefixes=WAVE64 %s
; RUN: lgc -mcpu=gfx1010 - < %s | FileCheck --check-prefixes=WAVE32 %s

define dllexport spir_func void @lgc.shader.CS.main() local_unnamed_addr #0 !lgc.shaderstage !0 {
Expand Down Expand Up @@ -32,8 +32,8 @@ attributes #0 = { nounwind }
; WAVE64: s_getpc_b64 s[2:3]
; WAVE64-NEXT: s_mov_b32 s0, s1
; WAVE64-NEXT: s_mov_b32 s1, s3
; WAVE64-NEXT: v_mov_b32_e32 v0, 7
; WAVE64-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x0
; WAVE64-NEXT: v_mov_b32_e32 v0, 4
; WAVE64-NEXT: s_waitcnt lgkmcnt(0)
; WAVE64-NEXT: buffer_store_dword v0, off, s[0:3], 0
; WAVE64-NEXT: s_endpgm
Expand Down
71 changes: 57 additions & 14 deletions lgc/test/BuiltIns/cs-numworkgroups.lgc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by tool/update_llpc_test_checks.py UTC_ARGS: --tool lgc --check-pal-metadata
; RUN: lgc -mcpu=gfx802 - < %s | FileCheck --check-prefixes=CHECK %s
; RUN: lgc -mcpu=gfx1010 - < %s | FileCheck --check-prefixes=CHECK %s

define dllexport spir_func void @lgc.shader.CS.main() local_unnamed_addr #0 !lgc.shaderstage !0 {
.entry:
Expand Down Expand Up @@ -43,30 +43,73 @@ attributes #0 = { nounwind }
; CHECK-NEXT: ---
; CHECK-NEXT: amdpal.pipelines:
; CHECK-NEXT: - .api: !str ''
; CHECK-NEXT: .compute_registers:
; CHECK-NEXT: .tg_size_en: true
; CHECK-NEXT: .tgid_x_en: false
; CHECK-NEXT: .tgid_y_en: false
; CHECK-NEXT: .tgid_z_en: false
; CHECK-NEXT: .tidig_comp_cnt: 0
; CHECK-NEXT: .hardware_stages:
; CHECK-NEXT: .cs:
; CHECK-NEXT: .checksum_value: 0
; CHECK-NEXT: .debug_mode: false
; CHECK-NEXT: .entry_point: _amdgpu_cs_main
; CHECK-NEXT: .excp_en: 0
; CHECK-NEXT: .float_mode: 0xc0
; CHECK-NEXT: .ieee_mode: false
; CHECK-NEXT: .lds_size: 0
; CHECK-NEXT: .mem_ordered: true
; CHECK-NEXT: .scratch_en: false
; CHECK-NEXT: .scratch_memory_size: 0
; CHECK-NEXT: .sgpr_count: 0x60
; CHECK-NEXT: .sgpr_limit: 0x66
; CHECK-NEXT: .sgpr_count: 0x8
; CHECK-NEXT: .sgpr_limit: 0x6a
; CHECK-NEXT: .threadgroup_dimensions:
; CHECK-NEXT: - 0
; CHECK-NEXT: - 0
; CHECK-NEXT: - 0
; CHECK-NEXT: .trap_present: false
; CHECK-NEXT: .user_data_reg_map:
; CHECK-NEXT: - 0x10000000
; CHECK-NEXT: - 0x10000006
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0x2
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: .user_sgprs: 0x4
; CHECK-NEXT: .vgpr_count: 0x3
; CHECK-NEXT: .vgpr_limit: 0x100
; CHECK-NEXT: .wavefront_size: 0x20
; CHECK-NEXT: .wgp_mode: false
; CHECK-NEXT: .internal_pipeline_hash:
; CHECK-NEXT: - 0
; CHECK-NEXT: - 0
; CHECK-NEXT: .registers:
; CHECK-NEXT: 0x2e07 (COMPUTE_NUM_THREAD_X): 0
; CHECK-NEXT: 0x2e08 (COMPUTE_NUM_THREAD_Y): 0
; CHECK-NEXT: 0x2e09 (COMPUTE_NUM_THREAD_Z): 0
; CHECK-NEXT: 0x2e12 (COMPUTE_PGM_RSRC1): 0x2c02c0
; CHECK-NEXT: 0x2e13 (COMPUTE_PGM_RSRC2): 0x788
; CHECK-NEXT: 0x2e40 (COMPUTE_USER_DATA_0): 0x10000000
; CHECK-NEXT: 0x2e41 (COMPUTE_USER_DATA_1): 0x10000006
; CHECK-NEXT: 0x2e43 (COMPUTE_USER_DATA_3): 0x2
; CHECK-NEXT: .registers: {}
; CHECK-NEXT: .shaders:
; CHECK-NEXT: .compute:
; CHECK-NEXT: .api_shader_hash:
Expand All @@ -78,6 +121,6 @@ attributes #0 = { nounwind }
; CHECK-NEXT: .type: Cs
; CHECK-NEXT: .user_data_limit: 0x3
; CHECK-NEXT: amdpal.version:
; CHECK-NEXT: - 0x2
; CHECK-NEXT: - 0x6
; CHECK-NEXT: - 0x3
; CHECK-NEXT: - 0
; CHECK-NEXT: ...
15 changes: 0 additions & 15 deletions lgc/test/BuiltIns/cs-subgroupid.lgc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
; NOTE: Assertions have been autogenerated by tool/update_llpc_test_checks.py UTC_ARGS: --tool lgc
; RUN: lgc -mcpu=gfx802 - < %s | FileCheck --check-prefixes=WAVE64 %s
; RUN: lgc -mcpu=gfx1010 - < %s | FileCheck --check-prefixes=WAVE32 %s
; RUN: lgc -mcpu=gfx1030 - < %s | FileCheck --check-prefixes=GFX1030 %s

Expand Down Expand Up @@ -28,20 +27,6 @@ attributes #0 = { nounwind }
!2 = !{!"DescriptorBuffer", i32 6, i32 0, i32 0, i32 4, i32 0, i32 0, i32 4}
; Compute mode, containing workgroup size
!3 = !{i32 5, i32 6, i32 7}
; WAVE64-LABEL: amdgpu_cs_main:
; WAVE64: v_mul_lo_u32 v2, v2, 6
; WAVE64-NEXT: s_getpc_b64 s[2:3]
; WAVE64-NEXT: s_mov_b32 s0, s1
; WAVE64-NEXT: s_mov_b32 s1, s3
; WAVE64-NEXT: v_add_u32_e32 v1, vcc, v2, v1
; WAVE64-NEXT: v_mul_lo_u32 v1, v1, 5
; WAVE64-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x0
; WAVE64-NEXT: v_add_u32_e32 v0, vcc, v1, v0
; WAVE64-NEXT: v_lshrrev_b32_e32 v0, 6, v0
; WAVE64-NEXT: s_waitcnt lgkmcnt(0)
; WAVE64-NEXT: buffer_store_dword v0, off, s[0:3], 0
; WAVE64-NEXT: s_endpgm
;
; WAVE32-LABEL: amdgpu_cs_main:
; WAVE32: s_getpc_b64 s[2:3]
; WAVE32-NEXT: s_mov_b32 s0, s1
Expand Down
12 changes: 0 additions & 12 deletions lgc/test/BuiltIns/cs-subgrouplocalinvocationid.lgc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
; NOTE: Assertions have been autogenerated by tool/update_llpc_test_checks.py UTC_ARGS: --tool lgc
; RUN: lgc -mcpu=gfx802 - < %s | FileCheck --check-prefixes=WAVE64 %s
; RUN: lgc -mcpu=gfx1010 - < %s | FileCheck --check-prefixes=WAVE32 %s

define dllexport spir_func void @lgc.shader.CS.main() local_unnamed_addr #0 !lgc.shaderstage !0 {
Expand All @@ -24,17 +23,6 @@ attributes #0 = { nounwind }
!1 = !{!"DescriptorTableVaPtr", i32 0, i32 0, i32 2, i32 1, i32 1}
; type, offset, size, set, binding, stride
!2 = !{!"DescriptorBuffer", i32 6, i32 0, i32 0, i32 4, i32 0, i32 0, i32 4}
; WAVE64-LABEL: amdgpu_cs_main:
; WAVE64: s_getpc_b64 s[2:3]
; WAVE64-NEXT: s_mov_b32 s0, s1
; WAVE64-NEXT: s_mov_b32 s1, s3
; WAVE64-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x0
; WAVE64-NEXT: v_mbcnt_lo_u32_b32 v0, -1, 0
; WAVE64-NEXT: v_mbcnt_hi_u32_b32 v0, -1, v0
; WAVE64-NEXT: s_waitcnt lgkmcnt(0)
; WAVE64-NEXT: buffer_store_dword v0, off, s[0:3], 0
; WAVE64-NEXT: s_endpgm
;
; WAVE32-LABEL: amdgpu_cs_main:
; WAVE32: s_getpc_b64 s[2:3]
; WAVE32-NEXT: s_mov_b32 s0, s1
Expand Down
11 changes: 0 additions & 11 deletions lgc/test/BuiltIns/cs-subgroupsize.lgc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
; NOTE: Assertions have been autogenerated by tool/update_llpc_test_checks.py UTC_ARGS: --tool lgc
; RUN: lgc -mcpu=gfx802 - < %s | FileCheck --check-prefixes=WAVE64 %s
; RUN: lgc -mcpu=gfx1010 - < %s | FileCheck --check-prefixes=WAVE32 %s

define dllexport spir_func void @lgc.shader.CS.main() local_unnamed_addr #0 !lgc.shaderstage !0 {
Expand All @@ -25,16 +24,6 @@ attributes #0 = { nounwind }
; type, offset, size, set, binding, stride
!2 = !{!"DescriptorBuffer", i32 6, i32 0, i32 0, i32 4, i32 0, i32 0, i32 4}

; WAVE64-LABEL: amdgpu_cs_main:
; WAVE64: s_getpc_b64 s[2:3]
; WAVE64-NEXT: s_mov_b32 s0, s1
; WAVE64-NEXT: s_mov_b32 s1, s3
; WAVE64-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x0
; WAVE64-NEXT: v_mov_b32_e32 v0, 64
; WAVE64-NEXT: s_waitcnt lgkmcnt(0)
; WAVE64-NEXT: buffer_store_dword v0, off, s[0:3], 0
; WAVE64-NEXT: s_endpgm
;
; WAVE32-LABEL: amdgpu_cs_main:
; WAVE32: s_getpc_b64 s[2:3]
; WAVE32-NEXT: s_mov_b32 s0, s1
Expand Down
72 changes: 58 additions & 14 deletions lgc/test/BuiltIns/cs-workgroupid.lgc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by tool/update_llpc_test_checks.py UTC_ARGS: --tool lgc --check-pal-metadata
; RUN: lgc -mcpu=gfx802 - < %s | FileCheck --check-prefixes=CHECK %s
; RUN: lgc -mcpu=gfx1010 - < %s | FileCheck --check-prefixes=CHECK %s

define dllexport spir_func void @lgc.shader.CS.main() local_unnamed_addr #0 !lgc.shaderstage !0 {
.entry:
Expand Down Expand Up @@ -28,8 +28,8 @@ attributes #0 = { nounwind }
; CHECK: s_getpc_b64 s[6:7]
; CHECK-NEXT: s_mov_b32 s0, s1
; CHECK-NEXT: s_mov_b32 s1, s7
; CHECK-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x0
; CHECK-NEXT: v_mov_b32_e32 v0, s2
; CHECK-NEXT: s_load_dwordx4 s[8:11], s[0:1], 0x0
; CHECK-NEXT: v_mov_b32_e32 v1, s3
; CHECK-NEXT: v_mov_b32_e32 v2, s4
; CHECK-NEXT: s_waitcnt lgkmcnt(0)
Expand All @@ -40,29 +40,73 @@ attributes #0 = { nounwind }
; CHECK-NEXT: ---
; CHECK-NEXT: amdpal.pipelines:
; CHECK-NEXT: - .api: !str ''
; CHECK-NEXT: .compute_registers:
; CHECK-NEXT: .tg_size_en: true
; CHECK-NEXT: .tgid_x_en: true
; CHECK-NEXT: .tgid_y_en: true
; CHECK-NEXT: .tgid_z_en: true
; CHECK-NEXT: .tidig_comp_cnt: 0
; CHECK-NEXT: .hardware_stages:
; CHECK-NEXT: .cs:
; CHECK-NEXT: .checksum_value: 0
; CHECK-NEXT: .debug_mode: false
; CHECK-NEXT: .entry_point: _amdgpu_cs_main
; CHECK-NEXT: .excp_en: 0
; CHECK-NEXT: .float_mode: 0xc0
; CHECK-NEXT: .ieee_mode: false
; CHECK-NEXT: .lds_size: 0
; CHECK-NEXT: .mem_ordered: true
; CHECK-NEXT: .scratch_en: false
; CHECK-NEXT: .scratch_memory_size: 0
; CHECK-NEXT: .sgpr_count: 0x60
; CHECK-NEXT: .sgpr_limit: 0x66
; CHECK-NEXT: .sgpr_count: 0xc
; CHECK-NEXT: .sgpr_limit: 0x6a
; CHECK-NEXT: .threadgroup_dimensions:
; CHECK-NEXT: - 0
; CHECK-NEXT: - 0
; CHECK-NEXT: - 0
; CHECK-NEXT: .trap_present: false
; CHECK-NEXT: .user_data_reg_map:
; CHECK-NEXT: - 0x10000000
; CHECK-NEXT: - 0x2
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: - 0xffffffff
; CHECK-NEXT: .user_sgprs: 0x2
; CHECK-NEXT: .vgpr_count: 0x3
; CHECK-NEXT: .vgpr_limit: 0x100
; CHECK-NEXT: .wavefront_size: 0x20
; CHECK-NEXT: .wgp_mode: false
; CHECK-NEXT: .internal_pipeline_hash:
; CHECK-NEXT: - 0
; CHECK-NEXT: - 0
; CHECK-NEXT: .registers:
; CHECK-NEXT: 0x2e07 (COMPUTE_NUM_THREAD_X): 0
; CHECK-NEXT: 0x2e08 (COMPUTE_NUM_THREAD_Y): 0
; CHECK-NEXT: 0x2e09 (COMPUTE_NUM_THREAD_Z): 0
; CHECK-NEXT: 0x2e12 (COMPUTE_PGM_RSRC1): 0x2c02c0
; CHECK-NEXT: 0x2e13 (COMPUTE_PGM_RSRC2): 0x784
; CHECK-NEXT: 0x2e40 (COMPUTE_USER_DATA_0): 0x10000000
; CHECK-NEXT: 0x2e41 (COMPUTE_USER_DATA_1): 0x2
; CHECK-NEXT: .registers: {}
; CHECK-NEXT: .shaders:
; CHECK-NEXT: .compute:
; CHECK-NEXT: .api_shader_hash:
Expand All @@ -74,6 +118,6 @@ attributes #0 = { nounwind }
; CHECK-NEXT: .type: Cs
; CHECK-NEXT: .user_data_limit: 0x3
; CHECK-NEXT: amdpal.version:
; CHECK-NEXT: - 0x2
; CHECK-NEXT: - 0x6
; CHECK-NEXT: - 0x3
; CHECK-NEXT: - 0
; CHECK-NEXT: ...
4 changes: 2 additions & 2 deletions lgc/test/BuiltIns/cs-workgroupsize.lgc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by tool/update_llpc_test_checks.py UTC_ARGS: --tool lgc
; RUN: lgc -mcpu=gfx802 - < %s | FileCheck --check-prefixes=CHECK %s
; RUN: lgc -mcpu=gfx1010 - < %s | FileCheck --check-prefixes=CHECK %s

define dllexport spir_func void @lgc.shader.CS.main() local_unnamed_addr #0 !lgc.shaderstage !0 {
.entry:
Expand Down Expand Up @@ -31,8 +31,8 @@ attributes #0 = { nounwind }
; CHECK: s_getpc_b64 s[2:3]
; CHECK-NEXT: s_mov_b32 s0, s1
; CHECK-NEXT: s_mov_b32 s1, s3
; CHECK-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x0
; CHECK-NEXT: v_mov_b32_e32 v0, 5
; CHECK-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x0
; CHECK-NEXT: v_mov_b32_e32 v1, 6
; CHECK-NEXT: v_mov_b32_e32 v2, 7
; CHECK-NEXT: s_waitcnt lgkmcnt(0)
Expand Down
Loading

0 comments on commit 4483b12

Please sign in to comment.