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
102 ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 0
104 ; CHECK-NEXT: bb.3.exit:
105 ; CHECK-NEXT: PseudoRET
109 renamable $x10 = ADDI $x0, -1
120 SB $x0, %stack.0, 31 :: (store (s8) into %stack.0 + 31)
121 SB $x0, %stack.0, 30 :: (store (s8) into %stack.0 + 30)
122 SB $x0, %stack.0, 29 :: (store (s8) into %stack.0 + 29)
123 SB $x0, %stack.0, 28 :: (store (s8) into %stack.0 + 28)
124 SB $x0, %stack.0, 27 :: (store (s8) into %stack.0 + 27)
125 SB $x0, %stack.0, 26 :: (store (s8) into %stack.0 + 26)
126 SB $x0, %stack.0, 25 :: (store (s8) into %stack.0 + 25)
127 SB $x0, %stack.0, 24 :: (store (s8) into %stack.0 + 24)
128 SB $x0, %stack.0, 23 :: (store (s8) into %stack.0 + 23)
129 SB $x0, %stack.0, 22 :: (store (s8) into %stack.0 + 22)
130 SB $x0, %stack.0, 21 :: (store (s8) into %stack.0 + 21)
131 SB $x0, %stack.0, 20 :: (store (s8) into %stack.0 + 20)
132 SB $x0, %stack.0, 19 :: (store (s8) into %stack.0 + 19)
133 SB $x0, %stack.0, 18 :: (store (s8) into %stack.0 + 18)
134 SB $x0, %stack.0, 17 :: (store (s8) into %stack.0 + 17)
135 SB $x0, %stack.0, 16 :: (store (s8) into %stack.0 + 16)
136 SB renamable $x10, %stack.0, 0 :: (store (s8) into %stack.0)
137 SB renamable $x10, %stack.0, 4 :: (store (s8) into %stack.0 + 4)
138 renamable $x11 = SRLI renamable $x10, 24
139 SB renamable $x11, %stack.0, 3 :: (store (s8) into %stack.0 + 3)
140 renamable $x12 = SRLI renamable $x10, 16
141 SB renamable $x12, %stack.0, 2 :: (store (s8) into %stack.0 + 2)
142 renamable $x13 = SRLI renamable $x10, 8
143 SB renamable $x13, %stack.0, 1 :: (store (s8) into %stack.0 + 1)
144 SB renamable $x10, %stack.0, 8 :: (store (s8) into %stack.0 + 8)
145 SB renamable $x11, %stack.0, 7 :: (store (s8) into %stack.0 + 7)
146 SB renamable $x12, %stack.0, 6 :: (store (s8) into %stack.0 + 6)
147 SB renamable $x13, %stack.0, 5 :: (store (s8) into %stack.0 + 5)
148 SB killed renamable $x10, %stack.0, 12 :: (store (s8) into %stack.0 + 12)
149 SB renamable $x11, %stack.0, 11 :: (store (s8) into %stack.0 + 11)
150 SB renamable $x12, %stack.0, 10 :: (store (s8) into %stack.0 + 10)
151 SB renamable $x13, %stack.0, 9 :: (store (s8) into %stack.0 + 9)
152 SB killed renamable $x11, %stack.0, 15 :: (store (s8) into %stack.0 + 15)
153 SB killed renamable $x12, %stack.0, 14 :: (store (s8) into %stack.0 + 14)
154 SB killed renamable $x13, %stack.0, 13 :: (store (s8) into %stack.0 + 13)