1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -O3 -march=mipsel -mcpu=mips32r6 -mattr=+fp64,+msa %s -o - | FileCheck %s
4 ; Test that checks if spill for ldi can be avoided and instruction will be
7 declare dso_local void @foo()
9 define dso_local void @test_ldi_b() {
10 ; CHECK-LABEL: test_ldi_b:
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: addiu $sp, $sp, -24
13 ; CHECK-NEXT: .cfi_def_cfa_offset 24
14 ; CHECK-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
15 ; CHECK-NEXT: .cfi_offset 31, -4
16 ; CHECK-NEXT: ldi.b $w0, 1
21 ; CHECK-NEXT: ldi.b $w0, 1
24 ; CHECK-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
26 ; CHECK-NEXT: addiu $sp, $sp, 24
28 tail call void asm sideeffect "", "f,~{memory},~{$1}"(<16 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>)
30 tail call void asm sideeffect "", "f,~{memory},~{$1}"(<16 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>)
34 define dso_local void @test_ldi_h() {
35 ; CHECK-LABEL: test_ldi_h:
36 ; CHECK: # %bb.0: # %entry
37 ; CHECK-NEXT: addiu $sp, $sp, -24
38 ; CHECK-NEXT: .cfi_def_cfa_offset 24
39 ; CHECK-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
40 ; CHECK-NEXT: .cfi_offset 31, -4
41 ; CHECK-NEXT: ldi.h $w0, 2
46 ; CHECK-NEXT: ldi.h $w0, 2
49 ; CHECK-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
51 ; CHECK-NEXT: addiu $sp, $sp, 24
53 tail call void asm sideeffect "", "f,~{memory},~{$1}"(<8 x i16> <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>)
55 tail call void asm sideeffect "", "f,~{memory},~{$1}"(<8 x i16> <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>)
59 define dso_local void @test_ldi_w() {
60 ; CHECK-LABEL: test_ldi_w:
61 ; CHECK: # %bb.0: # %entry
62 ; CHECK-NEXT: addiu $sp, $sp, -24
63 ; CHECK-NEXT: .cfi_def_cfa_offset 24
64 ; CHECK-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
65 ; CHECK-NEXT: .cfi_offset 31, -4
66 ; CHECK-NEXT: ldi.w $w0, 3
71 ; CHECK-NEXT: ldi.w $w0, 3
74 ; CHECK-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
76 ; CHECK-NEXT: addiu $sp, $sp, 24
78 tail call void asm sideeffect "", "f,~{memory},~{$1}"(<4 x i32> <i32 3, i32 3, i32 3, i32 3>)
80 tail call void asm sideeffect "", "f,~{memory},~{$1}"(<4 x i32> <i32 3, i32 3, i32 3, i32 3>)
84 define dso_local void @test_ldi_d() {
85 ; CHECK-LABEL: test_ldi_d:
86 ; CHECK: # %bb.0: # %entry
87 ; CHECK-NEXT: addiu $sp, $sp, -24
88 ; CHECK-NEXT: .cfi_def_cfa_offset 24
89 ; CHECK-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
90 ; CHECK-NEXT: .cfi_offset 31, -4
91 ; CHECK-NEXT: ldi.d $w0, 4
96 ; CHECK-NEXT: ldi.d $w0, 4
99 ; CHECK-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
101 ; CHECK-NEXT: addiu $sp, $sp, 24
103 tail call void asm sideeffect "", "f,~{memory},~{$1}"(<2 x i64> <i64 4, i64 4>)
104 tail call void @foo()
105 tail call void asm sideeffect "", "f,~{memory},~{$1}"(<2 x i64> <i64 4, i64 4>)