1 ; RUN: llc -march=mipsel -disable-mips-delay-filler -relocation-model=pic < %s | \
2 ; RUN: FileCheck %s -check-prefix=O32
3 ; RUN: llc -march=mipsel -mips-load-target-from-got=false \
4 ; RUN: -disable-mips-delay-filler -relocation-model=pic < %s | FileCheck %s -check-prefix=O32-LOADTGT
6 @gd1 = common global double 0.000000e+00, align 8
7 @gd2 = common global double 0.000000e+00, align 8
10 ; O32-DAG: lw $25, %call16(callee3)
14 ; O32: lw $25, %call16(callee3)
18 ; O32: lw $25, %call16(callee3)
22 ; O32-LOADTGT-LABEL: caller3:
23 ; O32-LOADTGT-DAG: lw $25, %call16(callee3)
24 ; O32-LOADTGT-DAG: move $gp
25 ; O32-LOADTGT: jalr $25
26 ; O32-LOADTGT-NOT: move $gp
27 ; O32-LOADTGT: move $25
28 ; O32-LOADTGT-NOT: move $gp
29 ; O32-LOADTGT: jalr $25
30 ; O32-LOADTGT-NOT: move $gp
31 ; O32-LOADTGT: move $25
32 ; O32-LOADTGT-NOT: move $gp
33 ; O32-LOADTGT: jalr $25
35 define void @caller3(i32 %n) {
37 tail call void @callee3()
38 tail call void @callee3()
39 %tobool1 = icmp eq i32 %n, 0
40 br i1 %tobool1, label %while.end, label %while.body
43 %n.addr.02 = phi i32 [ %dec, %while.body ], [ %n, %entry ]
44 %dec = add nsw i32 %n.addr.02, -1
45 tail call void @callee3()
46 %tobool = icmp eq i32 %dec, 0
47 br i1 %tobool, label %while.end, label %while.body
53 declare void @callee3()
56 ; O32-DAG: lw $25, %call16(ceil)
60 ; O32: lw $25, %call16(ceil)
64 ; O32: lw $25, %call16(ceil)
68 ; O32-LOADTGT-LABEL: caller4:
69 ; O32-LOADTGT-DAG: lw $25, %call16(ceil)
70 ; O32-LOADTGT-DAG: move $gp
71 ; O32-LOADTGT: jalr $25
72 ; O32-LOADTGT-NOT: move $gp
73 ; O32-LOADTGT: move $25
74 ; O32-LOADTGT-NOT: move $gp
75 ; O32-LOADTGT: jalr $25
76 ; O32-LOADTGT-NOT: move $gp
77 ; O32-LOADTGT: move $25
78 ; O32-LOADTGT-NOT: move $gp
79 ; O32-LOADTGT: jalr $25
81 define void @caller4(double %d) {
83 %call = tail call double @ceil(double %d)
84 %call1 = tail call double @ceil(double %call)
85 store double %call1, double* @gd2, align 8
86 %call2 = tail call double @ceil(double %call1)
87 store double %call2, double* @gd1, align 8
91 declare double @ceil(double)
93 ; Make sure that the MipsOptimizePICCall pass is run even for optnone functions,
94 ; as we have to make sure that jalr uses $t9 for PIC code in order to adhere to
96 define hidden double @foo(double %dbl) #0 {
99 %res = call double @sqrt(double %dbl)
103 declare double @sqrt(double)
105 attributes #0 = { noinline optnone }