Skip to content

Commit 737d4f1

Browse files
committed
[AMDGPU] Reorganize tests to unblock #112403
We’re facing an issue (#113782) that is currently blocking #112403. However, since #112403 involves extensive test changes, I’d prefer to land it as soon as possible. This PR reorganizes the tests by moving test cases expected to fail into a separate file. Additionally, it changes the `[15 x i32]` arguments to `[13 x i32]` to bypass the issue.
1 parent 2f243a5 commit 737d4f1

File tree

2 files changed

+66
-65
lines changed

2 files changed

+66
-65
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
; RUN: not --crash llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 %s -o - 2>&1 | FileCheck -enable-var-scope %s
2+
3+
; CHECK: LLVM ERROR: failed to find free scratch register
4+
5+
declare hidden void @external_void_func_a15i32_inreg([15 x i32] inreg) #0
6+
declare hidden void @external_void_func_a16i32_inreg([16 x i32] inreg) #0
7+
declare hidden void @external_void_func_a15i32_inreg_i32_inreg([15 x i32] inreg, i32 inreg) #0
8+
9+
define void @test_call_external_void_func_a15i32_inreg([15 x i32] inreg %arg0) #0 {
10+
call void @external_void_func_a15i32_inreg([15 x i32] inreg %arg0)
11+
ret void
12+
}
13+
14+
define void @test_call_external_void_func_a16i32_inreg([16 x i32] inreg %arg0) #0 {
15+
call void @external_void_func_a16i32_inreg([16 x i32] inreg %arg0)
16+
ret void
17+
}
18+
19+
define void @test_call_external_void_func_a15i32_inreg_i32_inreg([15 x i32] inreg %arg0, i32 inreg %arg1) #0 {
20+
call void @external_void_func_a15i32_inreg_i32_inreg([15 x i32] inreg %arg0, i32 inreg %arg1)
21+
ret void
22+
}
23+
24+
attributes #0 = { nounwind }
25+
26+
!llvm.module.flags = !{!0}
27+
!0 = !{i32 1, !"amdhsa_code_object_version", i32 400}

llvm/test/CodeGen/AMDGPU/call-args-inreg.ll

Lines changed: 39 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ declare hidden void @external_void_func_v2p5_inreg(<2 x ptr addrspace(5)> inreg)
2828

2929
declare hidden void @external_void_func_i64_inreg_i32_inreg_i64_inreg(i64 inreg, i32 inreg, i64 inreg) #0
3030

31-
declare hidden void @external_void_func_a15i32_inreg([15 x i32] inreg) #0
32-
declare hidden void @external_void_func_a16i32_inreg([16 x i32] inreg) #0
33-
declare hidden void @external_void_func_a15i32_inreg_i32_inreg([15 x i32] inreg, i32 inreg) #0
34-
declare hidden void @external_void_func_a15i32_inreg_i32_inreg__noimplicit([15 x i32] inreg, i32 inreg) #1
31+
declare hidden void @external_void_func_a15i32_inreg([13 x i32] inreg) #0
32+
declare hidden void @external_void_func_a15i32_inreg_i32_inreg__noimplicit([13 x i32] inreg, i32 inreg) #1
3533

3634
define void @test_call_external_void_func_i8_inreg(i8 inreg %arg) #0 {
3735
; GFX9-LABEL: test_call_external_void_func_i8_inreg:
@@ -534,12 +532,6 @@ define void @test_call_external_void_func_v8i32_inreg(<8 x i32> inreg %arg) #0 {
534532
ret void
535533
}
536534

537-
; FIXME:
538-
; define void @test_call_external_void_func_v16i32_inreg(<16 x i32> inreg %arg) #0 {
539-
; call void @external_void_func_v16i32_inreg(<16 x i32> inreg %arg)
540-
; ret void
541-
; }
542-
543535
define void @test_call_external_void_func_f16_inreg(half inreg %arg) #0 {
544536
; GFX9-LABEL: test_call_external_void_func_f16_inreg:
545537
; GFX9: ; %bb.0:
@@ -1402,16 +1394,16 @@ define void @test_call_external_void_func_i64_inreg_i32_inreg_i64_inreg(i64 inre
14021394
ret void
14031395
}
14041396

1405-
define void @test_call_external_void_func_a15i32_inreg([15 x i32] inreg %arg0) #0 {
1397+
define void @test_call_external_void_func_a15i32_inreg([13 x i32] inreg %arg0) #0 {
14061398
; GFX9-LABEL: test_call_external_void_func_a15i32_inreg:
14071399
; GFX9: ; %bb.0:
14081400
; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1409-
; GFX9-NEXT: s_mov_b32 s29, s33
1401+
; GFX9-NEXT: s_mov_b32 s27, s33
14101402
; GFX9-NEXT: s_mov_b32 s33, s32
1411-
; GFX9-NEXT: s_or_saveexec_b64 vcc, -1
1403+
; GFX9-NEXT: s_or_saveexec_b64 s[28:29], -1
14121404
; GFX9-NEXT: buffer_store_dword v40, off, s[0:3], s33 ; 4-byte Folded Spill
1413-
; GFX9-NEXT: s_mov_b64 exec, vcc
1414-
; GFX9-NEXT: v_writelane_b32 v40, s29, 2
1405+
; GFX9-NEXT: s_mov_b64 exec, s[28:29]
1406+
; GFX9-NEXT: v_writelane_b32 v40, s27, 2
14151407
; GFX9-NEXT: s_addk_i32 s32, 0x400
14161408
; GFX9-NEXT: v_writelane_b32 v40, s30, 0
14171409
; GFX9-NEXT: s_mov_b32 s3, s17
@@ -1427,13 +1419,11 @@ define void @test_call_external_void_func_a15i32_inreg([15 x i32] inreg %arg0) #
14271419
; GFX9-NEXT: s_mov_b32 s22, s24
14281420
; GFX9-NEXT: s_mov_b32 s23, s25
14291421
; GFX9-NEXT: s_mov_b32 s24, s26
1430-
; GFX9-NEXT: s_mov_b32 s25, s27
1431-
; GFX9-NEXT: s_mov_b32 s26, s28
14321422
; GFX9-NEXT: v_writelane_b32 v40, s31, 1
1433-
; GFX9-NEXT: s_getpc_b64 vcc
1434-
; GFX9-NEXT: s_add_u32 vcc_lo, vcc_lo, external_void_func_a15i32_inreg@rel32@lo+4
1435-
; GFX9-NEXT: s_addc_u32 vcc_hi, vcc_hi, external_void_func_a15i32_inreg@rel32@hi+12
1436-
; GFX9-NEXT: s_swappc_b64 s[30:31], vcc
1423+
; GFX9-NEXT: s_getpc_b64 s[28:29]
1424+
; GFX9-NEXT: s_add_u32 s28, s28, external_void_func_a15i32_inreg@rel32@lo+4
1425+
; GFX9-NEXT: s_addc_u32 s29, s29, external_void_func_a15i32_inreg@rel32@hi+12
1426+
; GFX9-NEXT: s_swappc_b64 s[30:31], s[28:29]
14371427
; GFX9-NEXT: v_readlane_b32 s31, v40, 1
14381428
; GFX9-NEXT: v_readlane_b32 s30, v40, 0
14391429
; GFX9-NEXT: v_readlane_b32 s4, v40, 2
@@ -1448,31 +1438,29 @@ define void @test_call_external_void_func_a15i32_inreg([15 x i32] inreg %arg0) #
14481438
; GFX11-LABEL: test_call_external_void_func_a15i32_inreg:
14491439
; GFX11: ; %bb.0:
14501440
; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1451-
; GFX11-NEXT: s_mov_b32 s25, s33
1441+
; GFX11-NEXT: s_mov_b32 s23, s33
14521442
; GFX11-NEXT: s_mov_b32 s33, s32
1453-
; GFX11-NEXT: s_or_saveexec_b32 s26, -1
1443+
; GFX11-NEXT: s_or_saveexec_b32 s24, -1
14541444
; GFX11-NEXT: scratch_store_b32 off, v40, s33 ; 4-byte Folded Spill
1455-
; GFX11-NEXT: s_mov_b32 exec_lo, s26
1456-
; GFX11-NEXT: v_writelane_b32 v40, s25, 2
1457-
; GFX11-NEXT: s_mov_b32 s26, s24
1458-
; GFX11-NEXT: s_mov_b32 s25, s23
1445+
; GFX11-NEXT: s_mov_b32 exec_lo, s24
1446+
; GFX11-NEXT: v_writelane_b32 v40, s23, 2
14591447
; GFX11-NEXT: s_mov_b32 s24, s22
14601448
; GFX11-NEXT: s_mov_b32 s23, s21
1461-
; GFX11-NEXT: v_writelane_b32 v40, s30, 0
14621449
; GFX11-NEXT: s_mov_b32 s22, s20
14631450
; GFX11-NEXT: s_mov_b32 s21, s19
1451+
; GFX11-NEXT: v_writelane_b32 v40, s30, 0
14641452
; GFX11-NEXT: s_mov_b32 s20, s18
14651453
; GFX11-NEXT: s_mov_b32 s19, s17
14661454
; GFX11-NEXT: s_mov_b32 s18, s16
14671455
; GFX11-NEXT: s_mov_b32 s17, s7
14681456
; GFX11-NEXT: s_mov_b32 s16, s6
14691457
; GFX11-NEXT: s_add_i32 s32, s32, 16
14701458
; GFX11-NEXT: v_writelane_b32 v40, s31, 1
1471-
; GFX11-NEXT: s_getpc_b64 s[28:29]
1472-
; GFX11-NEXT: s_add_u32 s28, s28, external_void_func_a15i32_inreg@rel32@lo+4
1473-
; GFX11-NEXT: s_addc_u32 s29, s29, external_void_func_a15i32_inreg@rel32@hi+12
1459+
; GFX11-NEXT: s_getpc_b64 s[26:27]
1460+
; GFX11-NEXT: s_add_u32 s26, s26, external_void_func_a15i32_inreg@rel32@lo+4
1461+
; GFX11-NEXT: s_addc_u32 s27, s27, external_void_func_a15i32_inreg@rel32@hi+12
14741462
; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
1475-
; GFX11-NEXT: s_swappc_b64 s[30:31], s[28:29]
1463+
; GFX11-NEXT: s_swappc_b64 s[30:31], s[26:27]
14761464
; GFX11-NEXT: v_readlane_b32 s31, v40, 1
14771465
; GFX11-NEXT: v_readlane_b32 s30, v40, 0
14781466
; GFX11-NEXT: v_readlane_b32 s0, v40, 2
@@ -1483,34 +1471,22 @@ define void @test_call_external_void_func_a15i32_inreg([15 x i32] inreg %arg0) #
14831471
; GFX11-NEXT: s_mov_b32 s33, s0
14841472
; GFX11-NEXT: s_waitcnt vmcnt(0)
14851473
; GFX11-NEXT: s_setpc_b64 s[30:31]
1486-
call void @external_void_func_a15i32_inreg([15 x i32] inreg %arg0)
1474+
call void @external_void_func_a15i32_inreg([13 x i32] inreg %arg0)
14871475
ret void
14881476
}
14891477

1490-
; FIXME:
1491-
; define void @test_call_external_void_func_a16i32_inreg([16 x i32] inreg %arg0) #0 {
1492-
; call void @external_void_func_a16i32_inreg([16 x i32] inreg %arg0)
1493-
; ret void
1494-
; }
1495-
1496-
; FIXME:
1497-
; define void @test_call_external_void_func_a15i32_inreg_i32_inreg([15 x i32] inreg %arg0, i32 inreg %arg1) #0 {
1498-
; call void @external_void_func_a15i32_inreg_i32_inreg([15 x i32] inreg %arg0, i32 inreg %arg1)
1499-
; ret void
1500-
; }
1501-
15021478

15031479
; FIXME: This should also fail
1504-
define void @test_call_external_void_func_a15i32_inreg_i32_inreg([15 x i32] inreg %arg0, i32 inreg %arg1) #1 {
1480+
define void @test_call_external_void_func_a15i32_inreg_i32_inreg([13 x i32] inreg %arg0, i32 inreg %arg1) #1 {
15051481
; GFX9-LABEL: test_call_external_void_func_a15i32_inreg_i32_inreg:
15061482
; GFX9: ; %bb.0:
15071483
; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1508-
; GFX9-NEXT: s_mov_b32 s23, s33
1484+
; GFX9-NEXT: s_mov_b32 s21, s33
15091485
; GFX9-NEXT: s_mov_b32 s33, s32
1510-
; GFX9-NEXT: s_or_saveexec_b64 s[24:25], -1
1486+
; GFX9-NEXT: s_or_saveexec_b64 s[22:23], -1
15111487
; GFX9-NEXT: buffer_store_dword v40, off, s[0:3], s33 ; 4-byte Folded Spill
1512-
; GFX9-NEXT: s_mov_b64 exec, s[24:25]
1513-
; GFX9-NEXT: v_writelane_b32 v40, s23, 2
1488+
; GFX9-NEXT: s_mov_b64 exec, s[22:23]
1489+
; GFX9-NEXT: v_writelane_b32 v40, s21, 2
15141490
; GFX9-NEXT: s_addk_i32 s32, 0x400
15151491
; GFX9-NEXT: v_writelane_b32 v40, s30, 0
15161492
; GFX9-NEXT: s_mov_b32 s3, s7
@@ -1527,13 +1503,11 @@ define void @test_call_external_void_func_a15i32_inreg_i32_inreg([15 x i32] inre
15271503
; GFX9-NEXT: s_mov_b32 s11, s18
15281504
; GFX9-NEXT: s_mov_b32 s15, s19
15291505
; GFX9-NEXT: s_mov_b32 s16, s20
1530-
; GFX9-NEXT: s_mov_b32 s17, s21
1531-
; GFX9-NEXT: s_mov_b32 s18, s22
15321506
; GFX9-NEXT: v_writelane_b32 v40, s31, 1
1533-
; GFX9-NEXT: s_getpc_b64 s[24:25]
1534-
; GFX9-NEXT: s_add_u32 s24, s24, external_void_func_a15i32_inreg_i32_inreg__noimplicit@rel32@lo+4
1535-
; GFX9-NEXT: s_addc_u32 s25, s25, external_void_func_a15i32_inreg_i32_inreg__noimplicit@rel32@hi+12
1536-
; GFX9-NEXT: s_swappc_b64 s[30:31], s[24:25]
1507+
; GFX9-NEXT: s_getpc_b64 s[22:23]
1508+
; GFX9-NEXT: s_add_u32 s22, s22, external_void_func_a15i32_inreg_i32_inreg__noimplicit@rel32@lo+4
1509+
; GFX9-NEXT: s_addc_u32 s23, s23, external_void_func_a15i32_inreg_i32_inreg__noimplicit@rel32@hi+12
1510+
; GFX9-NEXT: s_swappc_b64 s[30:31], s[22:23]
15371511
; GFX9-NEXT: v_readlane_b32 s31, v40, 1
15381512
; GFX9-NEXT: v_readlane_b32 s30, v40, 0
15391513
; GFX9-NEXT: v_readlane_b32 s4, v40, 2
@@ -1548,19 +1522,19 @@ define void @test_call_external_void_func_a15i32_inreg_i32_inreg([15 x i32] inre
15481522
; GFX11-LABEL: test_call_external_void_func_a15i32_inreg_i32_inreg:
15491523
; GFX11: ; %bb.0:
15501524
; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
1551-
; GFX11-NEXT: s_mov_b32 s19, s33
1525+
; GFX11-NEXT: s_mov_b32 s17, s33
15521526
; GFX11-NEXT: s_mov_b32 s33, s32
1553-
; GFX11-NEXT: s_or_saveexec_b32 s20, -1
1527+
; GFX11-NEXT: s_or_saveexec_b32 s18, -1
15541528
; GFX11-NEXT: scratch_store_b32 off, v40, s33 ; 4-byte Folded Spill
1555-
; GFX11-NEXT: s_mov_b32 exec_lo, s20
1556-
; GFX11-NEXT: v_writelane_b32 v40, s19, 2
1529+
; GFX11-NEXT: s_mov_b32 exec_lo, s18
1530+
; GFX11-NEXT: v_writelane_b32 v40, s17, 2
15571531
; GFX11-NEXT: s_add_i32 s32, s32, 16
1558-
; GFX11-NEXT: s_getpc_b64 s[20:21]
1559-
; GFX11-NEXT: s_add_u32 s20, s20, external_void_func_a15i32_inreg_i32_inreg__noimplicit@rel32@lo+4
1560-
; GFX11-NEXT: s_addc_u32 s21, s21, external_void_func_a15i32_inreg_i32_inreg__noimplicit@rel32@hi+12
1532+
; GFX11-NEXT: s_getpc_b64 s[18:19]
1533+
; GFX11-NEXT: s_add_u32 s18, s18, external_void_func_a15i32_inreg_i32_inreg__noimplicit@rel32@lo+4
1534+
; GFX11-NEXT: s_addc_u32 s19, s19, external_void_func_a15i32_inreg_i32_inreg__noimplicit@rel32@hi+12
15611535
; GFX11-NEXT: v_writelane_b32 v40, s30, 0
15621536
; GFX11-NEXT: v_writelane_b32 v40, s31, 1
1563-
; GFX11-NEXT: s_swappc_b64 s[30:31], s[20:21]
1537+
; GFX11-NEXT: s_swappc_b64 s[30:31], s[18:19]
15641538
; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
15651539
; GFX11-NEXT: v_readlane_b32 s31, v40, 1
15661540
; GFX11-NEXT: v_readlane_b32 s30, v40, 0
@@ -1572,7 +1546,7 @@ define void @test_call_external_void_func_a15i32_inreg_i32_inreg([15 x i32] inre
15721546
; GFX11-NEXT: s_mov_b32 s33, s0
15731547
; GFX11-NEXT: s_waitcnt vmcnt(0)
15741548
; GFX11-NEXT: s_setpc_b64 s[30:31]
1575-
call void @external_void_func_a15i32_inreg_i32_inreg__noimplicit([15 x i32] inreg %arg0, i32 inreg %arg1)
1549+
call void @external_void_func_a15i32_inreg_i32_inreg__noimplicit([13 x i32] inreg %arg0, i32 inreg %arg1)
15761550
ret void
15771551
}
15781552

0 commit comments

Comments
 (0)