1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass early-machinelicm -o - %s | FileCheck -check-prefix=GCN %s
3 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -passes early-machinelicm -o - %s | FileCheck -check-prefix=GCN %s
5 # MachineLICM shall limit hoisting of V_CVT instructions out of the loop keeping
6 # register pressure within the budget. VGPR budget at occupancy 10 is 24 vgprs.
10 tracksRegLiveness: true
12 ; GCN-LABEL: name: test
14 ; GCN-NEXT: successors: %bb.1(0x80000000)
15 ; GCN-NEXT: liveins: $vcc, $vgpr0
17 ; GCN-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
18 ; GCN-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
19 ; GCN-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr0
20 ; GCN-NEXT: [[COPY3:%[0-9]+]]:vgpr_32 = COPY $vgpr0
21 ; GCN-NEXT: [[COPY4:%[0-9]+]]:vgpr_32 = COPY $vgpr0
22 ; GCN-NEXT: [[COPY5:%[0-9]+]]:vgpr_32 = COPY $vgpr0
23 ; GCN-NEXT: [[COPY6:%[0-9]+]]:vgpr_32 = COPY $vgpr0
24 ; GCN-NEXT: [[COPY7:%[0-9]+]]:vgpr_32 = COPY $vgpr0
25 ; GCN-NEXT: [[COPY8:%[0-9]+]]:vgpr_32 = COPY $vgpr0
26 ; GCN-NEXT: [[COPY9:%[0-9]+]]:vgpr_32 = COPY $vgpr0
27 ; GCN-NEXT: [[COPY10:%[0-9]+]]:vgpr_32 = COPY $vgpr0
28 ; GCN-NEXT: [[COPY11:%[0-9]+]]:vgpr_32 = COPY $vgpr0
29 ; GCN-NEXT: [[COPY12:%[0-9]+]]:vgpr_32 = COPY $vgpr0
30 ; GCN-NEXT: [[COPY13:%[0-9]+]]:vgpr_32 = COPY $vgpr0
31 ; GCN-NEXT: [[COPY14:%[0-9]+]]:vgpr_32 = COPY $vgpr0
32 ; GCN-NEXT: [[COPY15:%[0-9]+]]:vgpr_32 = COPY $vgpr0
33 ; GCN-NEXT: [[COPY16:%[0-9]+]]:vgpr_32 = COPY $vgpr0
34 ; GCN-NEXT: [[COPY17:%[0-9]+]]:vgpr_32 = COPY $vgpr0
35 ; GCN-NEXT: [[V_CVT_F64_I32_e32_:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY]], implicit $mode, implicit $exec
36 ; GCN-NEXT: [[V_CVT_F64_I32_e32_1:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY1]], implicit $mode, implicit $exec
37 ; GCN-NEXT: [[V_CVT_F64_I32_e32_2:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY2]], implicit $mode, implicit $exec
38 ; GCN-NEXT: [[V_CVT_F64_I32_e32_3:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY3]], implicit $mode, implicit $exec
39 ; GCN-NEXT: [[V_CVT_F64_I32_e32_4:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY4]], implicit $mode, implicit $exec
40 ; GCN-NEXT: [[V_CVT_F64_I32_e32_5:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY5]], implicit $mode, implicit $exec
41 ; GCN-NEXT: [[V_CVT_F64_I32_e32_6:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY6]], implicit $mode, implicit $exec
42 ; GCN-NEXT: [[V_CVT_F64_I32_e32_7:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY7]], implicit $mode, implicit $exec
43 ; GCN-NEXT: [[V_CVT_F64_I32_e32_8:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY8]], implicit $mode, implicit $exec
44 ; GCN-NEXT: [[V_CVT_F64_I32_e32_9:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY9]], implicit $mode, implicit $exec
45 ; GCN-NEXT: [[V_CVT_F64_I32_e32_10:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY10]], implicit $mode, implicit $exec
46 ; GCN-NEXT: [[V_CVT_F64_I32_e32_11:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY11]], implicit $mode, implicit $exec
47 ; GCN-NEXT: [[V_CVT_F64_I32_e32_12:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY12]], implicit $mode, implicit $exec
50 ; GCN-NEXT: successors: %bb.2(0x04000000), %bb.1(0x7c000000)
51 ; GCN-NEXT: liveins: $vcc
53 ; GCN-NEXT: $vcc = S_AND_B64 $exec, $vcc, implicit-def $scc
54 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, [[V_CVT_F64_I32_e32_]], implicit $exec
55 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, [[V_CVT_F64_I32_e32_1]], implicit $exec
56 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, [[V_CVT_F64_I32_e32_2]], implicit $exec
57 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, [[V_CVT_F64_I32_e32_3]], implicit $exec
58 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, [[V_CVT_F64_I32_e32_4]], implicit $exec
59 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, [[V_CVT_F64_I32_e32_5]], implicit $exec
60 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, [[V_CVT_F64_I32_e32_6]], implicit $exec
61 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, [[V_CVT_F64_I32_e32_7]], implicit $exec
62 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, [[V_CVT_F64_I32_e32_8]], implicit $exec
63 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, [[V_CVT_F64_I32_e32_9]], implicit $exec
64 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, [[V_CVT_F64_I32_e32_10]], implicit $exec
65 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, [[V_CVT_F64_I32_e32_11]], implicit $exec
66 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, [[V_CVT_F64_I32_e32_12]], implicit $exec
67 ; GCN-NEXT: [[V_CVT_F64_I32_e32_13:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY13]], implicit $mode, implicit $exec
68 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, killed [[V_CVT_F64_I32_e32_13]], implicit $exec
69 ; GCN-NEXT: [[V_CVT_F64_I32_e32_14:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY14]], implicit $mode, implicit $exec
70 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, killed [[V_CVT_F64_I32_e32_14]], implicit $exec
71 ; GCN-NEXT: [[V_CVT_F64_I32_e32_15:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY15]], implicit $mode, implicit $exec
72 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, killed [[V_CVT_F64_I32_e32_15]], implicit $exec
73 ; GCN-NEXT: [[V_CVT_F64_I32_e32_16:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY16]], implicit $mode, implicit $exec
74 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, killed [[V_CVT_F64_I32_e32_16]], implicit $exec
75 ; GCN-NEXT: [[V_CVT_F64_I32_e32_17:%[0-9]+]]:vreg_64 = nofpexcept V_CVT_F64_I32_e32 [[COPY17]], implicit $mode, implicit $exec
76 ; GCN-NEXT: $vcc = V_CMP_EQ_U64_e64 $vcc, killed [[V_CVT_F64_I32_e32_17]], implicit $exec
77 ; GCN-NEXT: S_CBRANCH_VCCNZ %bb.1, implicit $vcc
78 ; GCN-NEXT: S_BRANCH %bb.2
81 ; GCN-NEXT: S_ENDPGM 0
83 successors: %bb.1(0x80000000)
86 %0:vgpr_32 = COPY $vgpr0
87 %1:vgpr_32 = COPY $vgpr0
88 %2:vgpr_32 = COPY $vgpr0
89 %3:vgpr_32 = COPY $vgpr0
90 %4:vgpr_32 = COPY $vgpr0
91 %5:vgpr_32 = COPY $vgpr0
92 %6:vgpr_32 = COPY $vgpr0
93 %7:vgpr_32 = COPY $vgpr0
94 %8:vgpr_32 = COPY $vgpr0
95 %9:vgpr_32 = COPY $vgpr0
96 %10:vgpr_32 = COPY $vgpr0
97 %11:vgpr_32 = COPY $vgpr0
98 %12:vgpr_32 = COPY $vgpr0
99 %13:vgpr_32 = COPY $vgpr0
100 %14:vgpr_32 = COPY $vgpr0
101 %15:vgpr_32 = COPY $vgpr0
102 %16:vgpr_32 = COPY $vgpr0
103 %17:vgpr_32 = COPY $vgpr0
106 successors: %bb.2(0x04000000), %bb.1(0x7c000000)
109 $vcc = S_AND_B64 $exec, $vcc, implicit-def $scc
110 %18:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %0, implicit $mode, implicit $exec
111 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %18, implicit $exec
112 %19:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %1, implicit $mode, implicit $exec
113 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %19, implicit $exec
114 %20:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %2, implicit $mode, implicit $exec
115 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %20, implicit $exec
116 %21:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %3, implicit $mode, implicit $exec
117 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %21, implicit $exec
118 %22:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %4, implicit $mode, implicit $exec
119 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %22, implicit $exec
120 %23:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %5, implicit $mode, implicit $exec
121 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %23, implicit $exec
122 %24:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %6, implicit $mode, implicit $exec
123 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %24, implicit $exec
124 %25:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %7, implicit $mode, implicit $exec
125 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %25, implicit $exec
126 %26:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %8, implicit $mode, implicit $exec
127 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %26, implicit $exec
128 %27:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %9, implicit $mode, implicit $exec
129 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %27, implicit $exec
130 %28:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %10, implicit $mode, implicit $exec
131 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %28, implicit $exec
132 %29:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %11, implicit $mode, implicit $exec
133 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %29, implicit $exec
134 %30:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %12, implicit $mode, implicit $exec
135 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %30, implicit $exec
136 %31:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %13, implicit $mode, implicit $exec
137 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %31, implicit $exec
138 %32:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %14, implicit $mode, implicit $exec
139 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %32, implicit $exec
140 %33:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %15, implicit $mode, implicit $exec
141 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %33, implicit $exec
142 %34:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %16, implicit $mode, implicit $exec
143 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %34, implicit $exec
144 %35:vreg_64 = nofpexcept V_CVT_F64_I32_e32 %17, implicit $mode, implicit $exec
145 $vcc = V_CMP_EQ_U64_e64 $vcc, killed %35, implicit $exec
146 S_CBRANCH_VCCNZ %bb.1, implicit $vcc