Skip to content

Commit e84ecf2

Browse files
[NFC][PowerPC] Add test to check lanemasks for subregisters. (#94363)
This change adds a test case to check the lane masks for a varitey of subregisters.
1 parent 3a47d94 commit e84ecf2

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# RUN: llc -mcpu=pwr10 -ppc-track-subreg-liveness -filetype=null \
2+
# RUN: -mtriple=powerpc64le-unknown-linux-gnu -run-pass=greedy,virtregrewriter \
3+
# RUN: -debug-only=regalloc -o - %s 2>&1 | FileCheck %s
4+
# REQUIRES: asserts
5+
6+
# Keep track of all of the lanemasks for various subregsiters.
7+
#
8+
# TODO: The mask for %6.sub_vsx1:accrc is the same as the mask for %10.sub_vsx1_then_sub_64:accrc.
9+
# Ideally on PowerPC these masks should be different. To be addressed in a later patch.
10+
#
11+
# CHECK: %3 [80r,80d:0) 0@80r L0000000000000004 [80r,80d:0) 0@80r weight:0.000000e+00
12+
# CHECK: %4 [96r,96d:0) 0@96r L0000000000000800 [96r,96d:0) 0@96r weight:0.000000e+00
13+
# CHECK: %5 [112r,112d:0) 0@112r L0000000000000004 [112r,112d:0) 0@112r weight:0.000000e+00
14+
# CHECK: %6 [128r,128d:0) 0@128r L0000000000000800 [128r,128d:0) 0@128r weight:0.000000e+00
15+
# CHECK: %7 [144r,144d:0) 0@144r L0000000000000004 [144r,144d:0) 0@144r weight:0.000000e+00
16+
# CHECK: %8 [160r,160d:0) 0@160r L0000000000000800 [160r,160d:0) 0@160r weight:0.000000e+00
17+
# CHECK: %9 [176r,176d:0) 0@176r L0000000000000004 [176r,176d:0) 0@176r weight:0.000000e+00
18+
# CHECK: %10 [192r,192d:0) 0@192r L0000000000000800 [192r,192d:0) 0@192r weight:0.000000e+00
19+
# CHECK: %11 [208r,208d:0) 0@208r L0000000000001000 [208r,208d:0) 0@208r weight:0.000000e+00
20+
# CHECK: %12 [224r,224d:0) 0@224r L0000000000002000 [224r,224d:0) 0@224r weight:0.000000e+00
21+
# CHECK: %13 [240r,240d:0) 0@240r L0000000000000804 [240r,240d:0) 0@240r weight:0.000000e+00
22+
# CHECK: %14 [256r,256d:0) 0@256r L0000000000003000 [256r,256d:0) 0@256r weight:0.000000e+00
23+
24+
25+
# CHECK: 0B bb.0
26+
# CHECK-NEXT: liveins
27+
# CHECK-NEXT: 16B %0:vsrc = COPY $v2
28+
# CHECK-NEXT: 32B %float:fprc = COPY %0.sub_64:vsrc
29+
# CHECK-NEXT: 48B dead undef %pair.sub_vsx0:vsrprc = COPY $v2
30+
# CHECK-NEXT: 64B undef %15.sub_vsx1:vsrprc = COPY $v3
31+
# CHECK-NEXT: 80B dead undef %3.sub_vsx0:vsrprc = COPY %0:vsrc
32+
# CHECK-NEXT: 96B dead undef %4.sub_vsx1:vsrprc = COPY %0:vsrc
33+
# CHECK-NEXT: 112B dead undef %5.sub_vsx0:accrc = COPY %0:vsrc
34+
# CHECK-NEXT: 128B dead undef %6.sub_vsx1:accrc = COPY %0:vsrc
35+
# CHECK-NEXT: 144B dead undef %7.sub_64:vsrprc = COPY %float:fprc
36+
# CHECK-NEXT: 160B dead undef %8.sub_vsx1_then_sub_64:vsrprc = COPY %float:fprc
37+
# CHECK-NEXT: 176B dead undef %9.sub_64:accrc = COPY %float:fprc
38+
# CHECK-NEXT: 192B dead undef %10.sub_vsx1_then_sub_64:accrc = COPY %float:fprc
39+
# CHECK-NEXT: 208B dead undef %11.sub_pair1_then_sub_64:accrc = COPY %float:fprc
40+
# CHECK-NEXT: 224B dead undef %12.sub_pair1_then_sub_vsx1_then_sub_64:accrc = COPY %float:fprc
41+
# CHECK-NEXT: 240B dead undef %13.sub_pair0:accrc = COPY %15:vsrprc
42+
# CHECK-NEXT: 256B dead undef %14.sub_pair1:accrc = COPY %15:vsrprc
43+
44+
45+
---
46+
name: test
47+
tracksRegLiveness: true
48+
body: |
49+
bb.0:
50+
liveins: $v2, $v3
51+
%0:vsrc = COPY $v2
52+
%float:fprc = COPY %0.sub_64
53+
undef %pair.sub_vsx0:vsrprc = COPY $v2
54+
undef %pair.sub_vsx1:vsrprc = COPY $v3
55+
undef %1.sub_vsx0:vsrprc = COPY %0
56+
undef %2.sub_vsx1:vsrprc = COPY %0
57+
undef %3.sub_vsx0:accrc = COPY %0
58+
undef %4.sub_vsx1:accrc = COPY %0
59+
undef %5.sub_64:vsrprc = COPY %float
60+
undef %6.sub_vsx1_then_sub_64:vsrprc = COPY %float
61+
undef %7.sub_64:accrc = COPY %float
62+
undef %8.sub_vsx1_then_sub_64:accrc = COPY %float
63+
undef %9.sub_pair1_then_sub_64:accrc = COPY %float
64+
undef %10.sub_pair1_then_sub_vsx1_then_sub_64:accrc = COPY %float
65+
undef %11.sub_pair0:accrc = COPY %pair
66+
undef %12.sub_pair1:accrc = COPY %pair
67+
...

0 commit comments

Comments
 (0)