1 ; RUN: llc -march=mipsel -O0 < %s | FileCheck %s -check-prefix=None
2 ; RUN: llc -march=mipsel < %s | FileCheck %s -check-prefix=Default
3 ; RUN: llc -march=mipsel -O1 -relocation-model=static < %s | \
4 ; RUN: FileCheck %s -check-prefix=STATICO1
6 define void @foo1() nounwind {
19 tail call void @foo2(i32 3) nounwind
23 declare void @foo2(i32)
25 ; Check that cvt.d.w goes into jalr's delay slot.
27 define void @foo3(i32 %a) nounwind {
33 %conv = sitofp i32 %a to double
34 tail call void @foo4(double %conv) nounwind
38 declare void @foo4(double)
40 @g2 = external global i32
41 @g1 = external global i32
42 @g3 = external global i32
44 ; Check that branch delay slot can be filled with an instruction with operand
50 define void @foo5(i32 %a) nounwind {
52 %0 = load i32* @g2, align 4
53 %tobool = icmp eq i32 %a, 0
54 br i1 %tobool, label %if.else, label %if.then
57 %1 = load i32* @g1, align 4
58 %add = add nsw i32 %1, %0
59 store i32 %add, i32* @g1, align 4
63 %2 = load i32* @g3, align 4
64 %sub = sub nsw i32 %2, %0
65 store i32 %sub, i32* @g3, align 4
72 ; Check that delay slot filler can place mov.s or mov.d in delay slot.
77 define void @foo6(float %a0, double %a1) nounwind {
79 tail call void @foo7(double %a1, float %a0) nounwind
83 declare void @foo7(double, float)
85 ; Check that a store can move past other memory instructions.
88 ; STATICO1: jalr ${{[0-9]+}}
89 ; STATICO1-NEXT: sw ${{[0-9]+}}, %lo(g1)
91 @foo9 = common global void ()* null, align 4
93 define i32 @foo8(i32 %a) nounwind {
95 store i32 %a, i32* @g1, align 4
96 %0 = load void ()** @foo9, align 4
97 tail call void %0() nounwind
98 %1 = load i32* @g1, align 4
99 %add = add nsw i32 %1, %a