1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=mips-mti-linux-gnu -relocation-model=static \
3 ; RUN: -mips-tail-calls=1 -mcpu=mips32r2 -mattr=+use-indirect-jump-hazard \
4 ; RUN: -verify-machineinstrs | FileCheck %s --check-prefix=MIPS32R2
5 ; RUN: llc < %s -mtriple=mips-img-linux-gnu -relocation-model=static \
6 ; RUN: -mips-tail-calls=1 -mcpu=mips32r6 -mattr=+use-indirect-jump-hazard \
7 ; RUN: -verify-machineinstrs | FileCheck %s --check-prefix=MIPS32R6
8 ; RUN: llc < %s -mtriple=mips64-mti-linux-gnu -relocation-model=static \
9 ; RUN: -mips-tail-calls=1 -mcpu=mips64r2 -mattr=+use-indirect-jump-hazard \
10 ; RUN: -verify-machineinstrs | FileCheck %s --check-prefix=MIPS64R2
11 ; RUN: llc < %s -mtriple=mips64-img-linux-gnu -relocation-model=static \
12 ; RUN: -mips-tail-calls=1 -mcpu=mips64r6 -mattr=+use-indirect-jump-hazard \
13 ; RUN: -verify-machineinstrs | FileCheck %s --check-prefix=MIPS64R6
15 ; RUN: llc < %s -mtriple=mips-mti-linux-gnu -relocation-model=pic \
16 ; RUN: -mips-tail-calls=1 -mcpu=mips32r2 -mattr=+use-indirect-jump-hazard \
17 ; RUN: -verify-machineinstrs | FileCheck %s --check-prefix=PIC-MIPS32R2
18 ; RUN: llc < %s -mtriple=mips-img-linux-gnu -relocation-model=pic \
19 ; RUN: -mips-tail-calls=1 -mcpu=mips32r6 -mattr=+use-indirect-jump-hazard \
20 ; RUN: -verify-machineinstrs | FileCheck %s --check-prefix=PIC-MIPS32R6
21 ; RUN: llc < %s -mtriple=mips64-mti-linux-gnu -relocation-model=pic \
22 ; RUN: -mips-tail-calls=1 -mcpu=mips64r2 -mattr=+use-indirect-jump-hazard \
23 ; RUN: -verify-machineinstrs | FileCheck %s --check-prefix=PIC-MIPS64R2
24 ; RUN: llc < %s -mtriple=mips64-img-linux-gnu -relocation-model=pic \
25 ; RUN: -mips-tail-calls=1 -mcpu=mips64r6 -mattr=+use-indirect-jump-hazard \
26 ; RUN: -verify-machineinstrs | FileCheck %s --check-prefix=PIC-MIPS64R6
28 define void @fooNonTail(ptr nocapture %f1) nounwind {
29 ; MIPS32R2-LABEL: fooNonTail:
30 ; MIPS32R2: # %bb.0: # %entry
31 ; MIPS32R2-NEXT: addiu $sp, $sp, -24
32 ; MIPS32R2-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
33 ; MIPS32R2-NEXT: move $25, $4
34 ; MIPS32R2-NEXT: jalr.hb $25
35 ; MIPS32R2-NEXT: addiu $4, $zero, 13
36 ; MIPS32R2-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
37 ; MIPS32R2-NEXT: jr $ra
38 ; MIPS32R2-NEXT: addiu $sp, $sp, 24
40 ; MIPS32R6-LABEL: fooNonTail:
41 ; MIPS32R6: # %bb.0: # %entry
42 ; MIPS32R6-NEXT: addiu $sp, $sp, -24
43 ; MIPS32R6-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
44 ; MIPS32R6-NEXT: move $25, $4
45 ; MIPS32R6-NEXT: jalr.hb $25
46 ; MIPS32R6-NEXT: addiu $4, $zero, 13
47 ; MIPS32R6-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
48 ; MIPS32R6-NEXT: jr $ra
49 ; MIPS32R6-NEXT: addiu $sp, $sp, 24
51 ; MIPS64R2-LABEL: fooNonTail:
52 ; MIPS64R2: # %bb.0: # %entry
53 ; MIPS64R2-NEXT: daddiu $sp, $sp, -16
54 ; MIPS64R2-NEXT: sd $ra, 8($sp) # 8-byte Folded Spill
55 ; MIPS64R2-NEXT: move $25, $4
56 ; MIPS64R2-NEXT: jalr.hb $25
57 ; MIPS64R2-NEXT: daddiu $4, $zero, 13
58 ; MIPS64R2-NEXT: ld $ra, 8($sp) # 8-byte Folded Reload
59 ; MIPS64R2-NEXT: jr $ra
60 ; MIPS64R2-NEXT: daddiu $sp, $sp, 16
62 ; MIPS64R6-LABEL: fooNonTail:
63 ; MIPS64R6: # %bb.0: # %entry
64 ; MIPS64R6-NEXT: daddiu $sp, $sp, -16
65 ; MIPS64R6-NEXT: sd $ra, 8($sp) # 8-byte Folded Spill
66 ; MIPS64R6-NEXT: move $25, $4
67 ; MIPS64R6-NEXT: jalr.hb $25
68 ; MIPS64R6-NEXT: daddiu $4, $zero, 13
69 ; MIPS64R6-NEXT: ld $ra, 8($sp) # 8-byte Folded Reload
70 ; MIPS64R6-NEXT: jr $ra
71 ; MIPS64R6-NEXT: daddiu $sp, $sp, 16
73 ; PIC-MIPS32R2-LABEL: fooNonTail:
74 ; PIC-MIPS32R2: # %bb.0: # %entry
75 ; PIC-MIPS32R2-NEXT: addiu $sp, $sp, -24
76 ; PIC-MIPS32R2-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
77 ; PIC-MIPS32R2-NEXT: move $25, $4
78 ; PIC-MIPS32R2-NEXT: jalr.hb $25
79 ; PIC-MIPS32R2-NEXT: addiu $4, $zero, 13
80 ; PIC-MIPS32R2-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
81 ; PIC-MIPS32R2-NEXT: jr $ra
82 ; PIC-MIPS32R2-NEXT: addiu $sp, $sp, 24
84 ; PIC-MIPS32R6-LABEL: fooNonTail:
85 ; PIC-MIPS32R6: # %bb.0: # %entry
86 ; PIC-MIPS32R6-NEXT: addiu $sp, $sp, -24
87 ; PIC-MIPS32R6-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
88 ; PIC-MIPS32R6-NEXT: move $25, $4
89 ; PIC-MIPS32R6-NEXT: jalr.hb $25
90 ; PIC-MIPS32R6-NEXT: addiu $4, $zero, 13
91 ; PIC-MIPS32R6-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
92 ; PIC-MIPS32R6-NEXT: jr $ra
93 ; PIC-MIPS32R6-NEXT: addiu $sp, $sp, 24
95 ; PIC-MIPS64R2-LABEL: fooNonTail:
96 ; PIC-MIPS64R2: # %bb.0: # %entry
97 ; PIC-MIPS64R2-NEXT: daddiu $sp, $sp, -16
98 ; PIC-MIPS64R2-NEXT: sd $ra, 8($sp) # 8-byte Folded Spill
99 ; PIC-MIPS64R2-NEXT: move $25, $4
100 ; PIC-MIPS64R2-NEXT: jalr.hb $25
101 ; PIC-MIPS64R2-NEXT: daddiu $4, $zero, 13
102 ; PIC-MIPS64R2-NEXT: ld $ra, 8($sp) # 8-byte Folded Reload
103 ; PIC-MIPS64R2-NEXT: jr $ra
104 ; PIC-MIPS64R2-NEXT: daddiu $sp, $sp, 16
106 ; PIC-MIPS64R6-LABEL: fooNonTail:
107 ; PIC-MIPS64R6: # %bb.0: # %entry
108 ; PIC-MIPS64R6-NEXT: daddiu $sp, $sp, -16
109 ; PIC-MIPS64R6-NEXT: sd $ra, 8($sp) # 8-byte Folded Spill
110 ; PIC-MIPS64R6-NEXT: move $25, $4
111 ; PIC-MIPS64R6-NEXT: jalr.hb $25
112 ; PIC-MIPS64R6-NEXT: daddiu $4, $zero, 13
113 ; PIC-MIPS64R6-NEXT: ld $ra, 8($sp) # 8-byte Folded Reload
114 ; PIC-MIPS64R6-NEXT: jr $ra
115 ; PIC-MIPS64R6-NEXT: daddiu $sp, $sp, 16
117 call void %f1(i32 13) nounwind
121 define i32 @fooTail(ptr nocapture %f1) nounwind {
122 ; MIPS32R2-LABEL: fooTail:
123 ; MIPS32R2: # %bb.0: # %entry
124 ; MIPS32R2-NEXT: move $25, $4
125 ; MIPS32R2-NEXT: jr.hb $25
126 ; MIPS32R2-NEXT: addiu $4, $zero, 14
128 ; MIPS32R6-LABEL: fooTail:
129 ; MIPS32R6: # %bb.0: # %entry
130 ; MIPS32R6-NEXT: move $25, $4
131 ; MIPS32R6-NEXT: jr.hb $25
132 ; MIPS32R6-NEXT: addiu $4, $zero, 14
134 ; MIPS64R2-LABEL: fooTail:
135 ; MIPS64R2: # %bb.0: # %entry
136 ; MIPS64R2-NEXT: move $25, $4
137 ; MIPS64R2-NEXT: jr.hb $25
138 ; MIPS64R2-NEXT: daddiu $4, $zero, 14
140 ; MIPS64R6-LABEL: fooTail:
141 ; MIPS64R6: # %bb.0: # %entry
142 ; MIPS64R6-NEXT: move $25, $4
143 ; MIPS64R6-NEXT: jr.hb $25
144 ; MIPS64R6-NEXT: daddiu $4, $zero, 14
146 ; PIC-MIPS32R2-LABEL: fooTail:
147 ; PIC-MIPS32R2: # %bb.0: # %entry
148 ; PIC-MIPS32R2-NEXT: move $25, $4
149 ; PIC-MIPS32R2-NEXT: jr.hb $25
150 ; PIC-MIPS32R2-NEXT: addiu $4, $zero, 14
152 ; PIC-MIPS32R6-LABEL: fooTail:
153 ; PIC-MIPS32R6: # %bb.0: # %entry
154 ; PIC-MIPS32R6-NEXT: move $25, $4
155 ; PIC-MIPS32R6-NEXT: jr.hb $25
156 ; PIC-MIPS32R6-NEXT: addiu $4, $zero, 14
158 ; PIC-MIPS64R2-LABEL: fooTail:
159 ; PIC-MIPS64R2: # %bb.0: # %entry
160 ; PIC-MIPS64R2-NEXT: move $25, $4
161 ; PIC-MIPS64R2-NEXT: jr.hb $25
162 ; PIC-MIPS64R2-NEXT: daddiu $4, $zero, 14
164 ; PIC-MIPS64R6-LABEL: fooTail:
165 ; PIC-MIPS64R6: # %bb.0: # %entry
166 ; PIC-MIPS64R6-NEXT: move $25, $4
167 ; PIC-MIPS64R6-NEXT: jr.hb $25
168 ; PIC-MIPS64R6-NEXT: daddiu $4, $zero, 14
170 %0 = tail call i32 %f1(i32 14) nounwind