1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
3 # RUN: llc %s -o - -mtriple=riscv32 -mattr=+zcmp -target-abi ilp32 -run-pass=prologepilog \
4 # RUN: -simplify-mir -verify-machineinstrs | FileCheck %s
7 define hidden void @f(fp128 %a) local_unnamed_addr #0 {
9 %0 = bitcast fp128 %a to i128
10 %and.i = lshr i128 %0, 112
11 %1 = trunc i128 %and.i to i32
12 %2 = and i32 %1, 32767
13 %or.i = or i128 poison, 5192296858534827628530496329220096
16 if.end.i: ; preds = %entry
17 br i1 poison, label %exit, label %if.then12.i
19 if.then12.i: ; preds = %if.end.i
20 %sub13.i = sub nuw nsw i32 16495, %2
21 %sh_prom.i = zext i32 %sub13.i to i128
22 %shr14.i = lshr i128 %or.i, %sh_prom.i
23 %conv15.i = trunc i128 %shr14.i to i32
26 exit: ; preds = %if.then12.i, %if.end.i
27 %retval.0.i = phi i32 [ %conv15.i, %if.then12.i ], [ -1, %if.end.i ]
34 tracksRegLiveness: true
35 tracksDebugUserValues: true
44 - { id: 0, size: 32, alignment: 1, local-offset: -32 }
49 ; CHECK-LABEL: name: f
51 ; CHECK-NEXT: liveins: $x10
53 ; CHECK-NEXT: renamable $x10 = ADDI $x0, -1
55 ; CHECK-NEXT: bb.1.if.end.i:
56 ; CHECK-NEXT: liveins: $x10
58 ; CHECK-NEXT: BNE $x0, $x0, %bb.3
59 ; CHECK-NEXT: PseudoBR %bb.2
61 ; CHECK-NEXT: bb.2.if.then12.i:
62 ; CHECK-NEXT: liveins: $x10
64 ; CHECK-NEXT: $x2 = frame-setup ADDI $x2, -32
65 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 32
66 ; CHECK-NEXT: SB $x0, $x2, 31 :: (store (s8) into %stack.0 + 31)
67 ; CHECK-NEXT: SB $x0, $x2, 30 :: (store (s8) into %stack.0 + 30)
68 ; CHECK-NEXT: SB $x0, $x2, 29 :: (store (s8) into %stack.0 + 29)
69 ; CHECK-NEXT: SB $x0, $x2, 28 :: (store (s8) into %stack.0 + 28)
70 ; CHECK-NEXT: SB $x0, $x2, 27 :: (store (s8) into %stack.0 + 27)
71 ; CHECK-NEXT: SB $x0, $x2, 26 :: (store (s8) into %stack.0 + 26)
72 ; CHECK-NEXT: SB $x0, $x2, 25 :: (store (s8) into %stack.0 + 25)
73 ; CHECK-NEXT: SB $x0, $x2, 24 :: (store (s8) into %stack.0 + 24)
74 ; CHECK-NEXT: SB $x0, $x2, 23 :: (store (s8) into %stack.0 + 23)
75 ; CHECK-NEXT: SB $x0, $x2, 22 :: (store (s8) into %stack.0 + 22)
76 ; CHECK-NEXT: SB $x0, $x2, 21 :: (store (s8) into %stack.0 + 21)
77 ; CHECK-NEXT: SB $x0, $x2, 20 :: (store (s8) into %stack.0 + 20)
78 ; CHECK-NEXT: SB $x0, $x2, 19 :: (store (s8) into %stack.0 + 19)
79 ; CHECK-NEXT: SB $x0, $x2, 18 :: (store (s8) into %stack.0 + 18)
80 ; CHECK-NEXT: SB $x0, $x2, 17 :: (store (s8) into %stack.0 + 17)
81 ; CHECK-NEXT: SB $x0, $x2, 16 :: (store (s8) into %stack.0 + 16)
82 ; CHECK-NEXT: SB renamable $x10, $x2, 0 :: (store (s8) into %stack.0)
83 ; CHECK-NEXT: SB renamable $x10, $x2, 4 :: (store (s8) into %stack.0 + 4)
84 ; CHECK-NEXT: renamable $x11 = SRLI renamable $x10, 24
85 ; CHECK-NEXT: SB renamable $x11, $x2, 3 :: (store (s8) into %stack.0 + 3)
86 ; CHECK-NEXT: renamable $x12 = SRLI renamable $x10, 16
87 ; CHECK-NEXT: SB renamable $x12, $x2, 2 :: (store (s8) into %stack.0 + 2)
88 ; CHECK-NEXT: renamable $x13 = SRLI renamable $x10, 8
89 ; CHECK-NEXT: SB renamable $x13, $x2, 1 :: (store (s8) into %stack.0 + 1)
90 ; CHECK-NEXT: SB renamable $x10, $x2, 8 :: (store (s8) into %stack.0 + 8)
91 ; CHECK-NEXT: SB renamable $x11, $x2, 7 :: (store (s8) into %stack.0 + 7)
92 ; CHECK-NEXT: SB renamable $x12, $x2, 6 :: (store (s8) into %stack.0 + 6)
93 ; CHECK-NEXT: SB renamable $x13, $x2, 5 :: (store (s8) into %stack.0 + 5)
94 ; CHECK-NEXT: SB killed renamable $x10, $x2, 12 :: (store (s8) into %stack.0 + 12)
95 ; CHECK-NEXT: SB renamable $x11, $x2, 11 :: (store (s8) into %stack.0 + 11)
96 ; CHECK-NEXT: SB renamable $x12, $x2, 10 :: (store (s8) into %stack.0 + 10)
97 ; CHECK-NEXT: SB renamable $x13, $x2, 9 :: (store (s8) into %stack.0 + 9)
98 ; CHECK-NEXT: SB killed renamable $x11, $x2, 15 :: (store (s8) into %stack.0 + 15)
99 ; CHECK-NEXT: SB killed renamable $x12, $x2, 14 :: (store (s8) into %stack.0 + 14)
100 ; CHECK-NEXT: SB killed renamable $x13, $x2, 13 :: (store (s8) into %stack.0 + 13)
101 ; CHECK-NEXT: $x2 = frame-destroy ADDI $x2, 32
103 ; CHECK-NEXT: bb.3.exit:
104 ; CHECK-NEXT: PseudoRET
108 renamable $x10 = ADDI $x0, -1
119 SB $x0, %stack.0, 31 :: (store (s8) into %stack.0 + 31)
120 SB $x0, %stack.0, 30 :: (store (s8) into %stack.0 + 30)
121 SB $x0, %stack.0, 29 :: (store (s8) into %stack.0 + 29)
122 SB $x0, %stack.0, 28 :: (store (s8) into %stack.0 + 28)
123 SB $x0, %stack.0, 27 :: (store (s8) into %stack.0 + 27)
124 SB $x0, %stack.0, 26 :: (store (s8) into %stack.0 + 26)
125 SB $x0, %stack.0, 25 :: (store (s8) into %stack.0 + 25)
126 SB $x0, %stack.0, 24 :: (store (s8) into %stack.0 + 24)
127 SB $x0, %stack.0, 23 :: (store (s8) into %stack.0 + 23)
128 SB $x0, %stack.0, 22 :: (store (s8) into %stack.0 + 22)
129 SB $x0, %stack.0, 21 :: (store (s8) into %stack.0 + 21)
130 SB $x0, %stack.0, 20 :: (store (s8) into %stack.0 + 20)
131 SB $x0, %stack.0, 19 :: (store (s8) into %stack.0 + 19)
132 SB $x0, %stack.0, 18 :: (store (s8) into %stack.0 + 18)
133 SB $x0, %stack.0, 17 :: (store (s8) into %stack.0 + 17)
134 SB $x0, %stack.0, 16 :: (store (s8) into %stack.0 + 16)
135 SB renamable $x10, %stack.0, 0 :: (store (s8) into %stack.0)
136 SB renamable $x10, %stack.0, 4 :: (store (s8) into %stack.0 + 4)
137 renamable $x11 = SRLI renamable $x10, 24
138 SB renamable $x11, %stack.0, 3 :: (store (s8) into %stack.0 + 3)
139 renamable $x12 = SRLI renamable $x10, 16
140 SB renamable $x12, %stack.0, 2 :: (store (s8) into %stack.0 + 2)
141 renamable $x13 = SRLI renamable $x10, 8
142 SB renamable $x13, %stack.0, 1 :: (store (s8) into %stack.0 + 1)
143 SB renamable $x10, %stack.0, 8 :: (store (s8) into %stack.0 + 8)
144 SB renamable $x11, %stack.0, 7 :: (store (s8) into %stack.0 + 7)
145 SB renamable $x12, %stack.0, 6 :: (store (s8) into %stack.0 + 6)
146 SB renamable $x13, %stack.0, 5 :: (store (s8) into %stack.0 + 5)
147 SB killed renamable $x10, %stack.0, 12 :: (store (s8) into %stack.0 + 12)
148 SB renamable $x11, %stack.0, 11 :: (store (s8) into %stack.0 + 11)
149 SB renamable $x12, %stack.0, 10 :: (store (s8) into %stack.0 + 10)
150 SB renamable $x13, %stack.0, 9 :: (store (s8) into %stack.0 + 9)
151 SB killed renamable $x11, %stack.0, 15 :: (store (s8) into %stack.0 + 15)
152 SB killed renamable $x12, %stack.0, 14 :: (store (s8) into %stack.0 + 14)
153 SB killed renamable $x13, %stack.0, 13 :: (store (s8) into %stack.0 + 13)