Skip to content

Commit e0945df

Browse files
authored
[AMDGPU] Add test to show failure with SRC_*_HI registers. NFC. (#154828)
Since src_{private|shared}_{base|limit} registers are added and are not artifical compiler happily uses it when it can. In HW these registers do not exist and the encoding belongs to their 64-bit super-register or 32-bit low register. Same instructions will produce relocation if run through asm.
1 parent cf52436 commit e0945df

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -start-before=register-coalescer -show-mc-encoding -o - %s | FileCheck %s
2+
3+
# FIXME: These SRC_*_HI registers do not exist, although defined in the register file
4+
# and happily used by the coalescer. The resulting encoding is in fact belong
5+
# to the 64-bit register and corresponding *_LO 32-bit part of it.
6+
7+
# CHECK-LABEL: src_private_base:
8+
# CHECK: s_subb_u32 s0, SRC_PRIVATE_BASE_HI, s1 ; encoding: [0xed,0x01,0x80,0x82]
9+
---
10+
name: src_private_base
11+
tracksRegLiveness: true
12+
body: |
13+
bb.0:
14+
%0:sreg_64 = COPY $src_private_base
15+
%1:sreg_64 = IMPLICIT_DEF
16+
$scc = IMPLICIT_DEF
17+
%2:sreg_32 = S_SUBB_U32 killed %0.sub1:sreg_64, %1.sub1:sreg_64, implicit-def dead $scc, implicit killed $scc
18+
...
19+
20+
# CHECK-LABEL: src_private_limit:
21+
# CHECK: s_subb_u32 s0, SRC_PRIVATE_LIMIT_HI, s1 ; encoding: [0xee,0x01,0x80,0x82]
22+
---
23+
name: src_private_limit
24+
tracksRegLiveness: true
25+
body: |
26+
bb.0:
27+
%0:sreg_64 = COPY $src_private_limit
28+
%1:sreg_64 = IMPLICIT_DEF
29+
$scc = IMPLICIT_DEF
30+
%2:sreg_32 = S_SUBB_U32 killed %0.sub1:sreg_64, %1.sub1:sreg_64, implicit-def dead $scc, implicit killed $scc
31+
...
32+
33+
# CHECK-LABEL: src_shared_base:
34+
# CHECK: s_subb_u32 s0, SRC_SHARED_BASE_HI, s1 ; encoding: [0xeb,0x01,0x80,0x82]
35+
---
36+
name: src_shared_base
37+
tracksRegLiveness: true
38+
body: |
39+
bb.0:
40+
%0:sreg_64 = COPY $src_shared_base
41+
%1:sreg_64 = IMPLICIT_DEF
42+
$scc = IMPLICIT_DEF
43+
%2:sreg_32 = S_SUBB_U32 killed %0.sub1:sreg_64, %1.sub1:sreg_64, implicit-def dead $scc, implicit killed $scc
44+
...
45+
46+
# CHECK-LABEL: src_shared_limit:
47+
# CHECK: s_subb_u32 s0, SRC_SHARED_LIMIT_HI, s1 ; encoding: [0xec,0x01,0x80,0x82]
48+
---
49+
name: src_shared_limit
50+
tracksRegLiveness: true
51+
body: |
52+
bb.0:
53+
%0:sreg_64 = COPY $src_shared_limit
54+
%1:sreg_64 = IMPLICIT_DEF
55+
$scc = IMPLICIT_DEF
56+
%2:sreg_32 = S_SUBB_U32 killed %0.sub1:sreg_64, %1.sub1:sreg_64, implicit-def dead $scc, implicit killed $scc
57+
...

0 commit comments

Comments
 (0)