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