1
1
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2
2
; RUN: llc -mtriple=riscv32 -mattr=+experimental-xqccmp,+e -target-abi ilp32e -verify-machineinstrs < %s | FileCheck %s --check-prefix=RV32
3
3
4
+ declare i32 @__mulsi3 (i32 , i32 )
5
+
4
6
define ptr @func (ptr %s , i32 %_c , ptr %incdec.ptr , i1 %0 , i8 %conv14 ) #0 {
5
7
; RV32-LABEL: func:
6
8
; RV32: # %bb.0: # %entry
7
- ; RV32-NEXT: li a5, 1
8
- ; RV32-NEXT: andi t0, a3, 1
9
+ ; RV32-NEXT: qc.cm.push {ra, s0-s1}, -16
10
+ ; RV32-NEXT: .cfi_def_cfa_offset 16
11
+ ; RV32-NEXT: .cfi_offset ra, -4
12
+ ; RV32-NEXT: .cfi_offset s0, -8
13
+ ; RV32-NEXT: .cfi_offset s1, -12
14
+ ; RV32-NEXT: addi sp, sp, -8
15
+ ; RV32-NEXT: .cfi_def_cfa_offset 24
16
+ ; RV32-NEXT: sw a4, 4(sp) # 4-byte Folded Spill
17
+ ; RV32-NEXT: sw a2, 0(sp) # 4-byte Folded Spill
18
+ ; RV32-NEXT: mv a2, a1
19
+ ; RV32-NEXT: mv s1, a0
20
+ ; RV32-NEXT: li a0, 1
21
+ ; RV32-NEXT: andi a3, a3, 1
9
22
; RV32-NEXT: .LBB0_1: # %while.body
10
23
; RV32-NEXT: # =>This Inner Loop Header: Depth=1
11
- ; RV32-NEXT: mv a3, a5
12
- ; RV32-NEXT: li a5 , 0
13
- ; RV32-NEXT: bnez t0 , .LBB0_1
24
+ ; RV32-NEXT: mv s0, a0
25
+ ; RV32-NEXT: li a0 , 0
26
+ ; RV32-NEXT: bnez a3 , .LBB0_1
14
27
; RV32-NEXT: # %bb.2: # %while.end
15
- ; RV32-NEXT: slli a5, a1, 16
16
- ; RV32-NEXT: andi a3, a3, 1
17
- ; RV32-NEXT: add a1, a1, a5
18
- ; RV32-NEXT: add a2, a2, a3
19
- ; RV32-NEXT: slli a3, a1, 8
20
- ; RV32-NEXT: add a1, a1, a3
21
- ; RV32-NEXT: sw a1, 0(zero)
22
- ; RV32-NEXT: sb a4, 0(a2)
23
- ; RV32-NEXT: ret
28
+ ; RV32-NEXT: lui a0, 4112
29
+ ; RV32-NEXT: addi a1, a0, 257
30
+ ; RV32-NEXT: mv a0, a2
31
+ ; RV32-NEXT: call __mulsi3
32
+ ; RV32-NEXT: sw a0, 0(zero)
33
+ ; RV32-NEXT: andi s0, s0, 1
34
+ ; RV32-NEXT: lw a0, 0(sp) # 4-byte Folded Reload
35
+ ; RV32-NEXT: add s0, s0, a0
36
+ ; RV32-NEXT: lw a0, 4(sp) # 4-byte Folded Reload
37
+ ; RV32-NEXT: sb a0, 0(s0)
38
+ ; RV32-NEXT: mv a0, s1
39
+ ; RV32-NEXT: addi sp, sp, 8
40
+ ; RV32-NEXT: .cfi_def_cfa_offset 16
41
+ ; RV32-NEXT: qc.cm.popret {ra, s0-s1}, 16
24
42
entry:
25
43
br label %while.body
26
44
@@ -29,8 +47,8 @@ while.body: ; preds = %while.body, %entry
29
47
br i1 %0 , label %while.body , label %while.end
30
48
31
49
while.end: ; preds = %while.body
32
- %or5 = mul i32 %_c , 16843009
33
- store i32 %or5 , ptr null , align 4
50
+ %mul_result = call i32 @__mulsi3 ( i32 %_c , i32 16843009 )
51
+ store i32 %mul_result , ptr null , align 4
34
52
%1 = and i32 %n.addr.042 , 1
35
53
%scevgep = getelementptr i8 , ptr %incdec.ptr , i32 %1
36
54
store i8 %conv14 , ptr %scevgep , align 1
0 commit comments