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
5 ; RUN: llc -march=mipsel -disable-mips-df-forward-search=false \
6 ; RUN: -relocation-model=static < %s | FileCheck %s -check-prefix=FORWARD
8 define void @foo1() nounwind {
21 tail call void @foo2(i32 3) nounwind
25 declare void @foo2(i32)
27 ; Check that cvt.d.w goes into jalr's delay slot.
29 define void @foo3(i32 %a) nounwind {
35 %conv = sitofp i32 %a to double
36 tail call void @foo4(double %conv) nounwind
40 declare void @foo4(double)
42 @g2 = external global i32
43 @g1 = external global i32
44 @g3 = external global i32
46 ; Check that branch delay slot can be filled with an instruction with operand
52 define void @foo5(i32 %a) nounwind {
54 %0 = load i32* @g2, align 4
55 %tobool = icmp eq i32 %a, 0
56 br i1 %tobool, label %if.else, label %if.then
59 %1 = load i32* @g1, align 4
60 %add = add nsw i32 %1, %0
61 store i32 %add, i32* @g1, align 4
65 %2 = load i32* @g3, align 4
66 %sub = sub nsw i32 %2, %0
67 store i32 %sub, i32* @g3, align 4
74 ; Check that delay slot filler can place mov.s or mov.d in delay slot.
79 define void @foo6(float %a0, double %a1) nounwind {
81 tail call void @foo7(double %a1, float %a0) nounwind
85 declare void @foo7(double, float)
87 ; Check that a store can move past other memory instructions.
90 ; STATICO1: jalr ${{[0-9]+}}
91 ; STATICO1-NEXT: sw ${{[0-9]+}}, %lo(g1)
93 @foo9 = common global void ()* null, align 4
95 define i32 @foo8(i32 %a) nounwind {
97 store i32 %a, i32* @g1, align 4
98 %0 = load void ()** @foo9, align 4
99 tail call void %0() nounwind
100 %1 = load i32* @g1, align 4
101 %add = add nsw i32 %1, %a
105 ; Test searchForward. Check that the second jal's slot is filled with another
106 ; instruction in the same block.
113 define void @foo10() nounwind {
115 tail call void @foo11() nounwind
116 tail call void @foo11() nounwind
117 store i32 0, i32* @g1, align 4
118 tail call void @foo11() nounwind
119 store i32 0, i32* @g1, align 4
123 declare void @foo11()