@@ -13,13 +13,14 @@ body: |
13
13
; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
14
14
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
15
15
; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY2]](s32)
16
- ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
17
16
; CHECK: $x0 = COPY [[COPY]](p0)
18
17
; CHECK: $x1 = COPY [[COPY1]](p0)
19
18
; CHECK: $x2 = COPY [[ZEXT]](s64)
20
- ; CHECK: BL &memcpy, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit $x2
21
- ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
22
- ; CHECK: RET_ReallyLR
19
+ ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
20
+ ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
21
+ ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[C1]], [[C]]
22
+ ; CHECK: $w3 = COPY [[AND]](s32)
23
+ ; CHECK: TCRETURNdi &memcpy, 0, csr_aarch64_aapcs, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit $w3
23
24
%0:_(p0) = COPY $x0
24
25
%1:_(p0) = COPY $x1
25
26
%2:_(s32) = COPY $w2
@@ -42,13 +43,14 @@ body: |
42
43
; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
43
44
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
44
45
; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY2]](s32)
45
- ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
46
46
; CHECK: $x0 = COPY [[COPY]](p0)
47
47
; CHECK: $x1 = COPY [[COPY1]](p0)
48
48
; CHECK: $x2 = COPY [[ZEXT]](s64)
49
- ; CHECK: BL &memmove, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit $x2
50
- ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
51
- ; CHECK: RET_ReallyLR
49
+ ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
50
+ ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
51
+ ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[C1]], [[C]]
52
+ ; CHECK: $w3 = COPY [[AND]](s32)
53
+ ; CHECK: TCRETURNdi &memmove, 0, csr_aarch64_aapcs, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit $w3
52
54
%0:_(p0) = COPY $x0
53
55
%1:_(p0) = COPY $x1
54
56
%2:_(s32) = COPY $w2
@@ -71,14 +73,15 @@ body: |
71
73
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
72
74
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
73
75
; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY2]](s32)
74
- ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
75
76
; CHECK: $x0 = COPY [[COPY]](p0)
76
77
; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
77
78
; CHECK: $w1 = COPY [[COPY3]](s32)
78
79
; CHECK: $x2 = COPY [[ZEXT]](s64)
79
- ; CHECK: BL &memset, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $w1, implicit $x2
80
- ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
81
- ; CHECK: RET_ReallyLR
80
+ ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
81
+ ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
82
+ ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[C1]], [[C]]
83
+ ; CHECK: $w3 = COPY [[AND]](s32)
84
+ ; CHECK: TCRETURNdi &memset, 0, csr_aarch64_aapcs, implicit $sp, implicit $x0, implicit $w1, implicit $x2, implicit $w3
82
85
%0:_(p0) = COPY $x0
83
86
%1:_(s32) = COPY $w1
84
87
%2:_(s32) = COPY $w2
@@ -89,3 +92,68 @@ body: |
89
92
RET_ReallyLR
90
93
91
94
...
95
+ ---
96
+ name : no_tail_call
97
+ tracksRegLiveness : true
98
+ body : |
99
+ bb.1:
100
+ liveins: $w2, $x0, $x1
101
+
102
+ ; CHECK-LABEL: name: no_tail_call
103
+ ; CHECK: liveins: $w2, $x0, $x1
104
+ ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
105
+ ; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
106
+ ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
107
+ ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY2]](s32)
108
+ ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
109
+ ; CHECK: $x0 = COPY [[COPY]](p0)
110
+ ; CHECK: $x1 = COPY [[COPY1]](p0)
111
+ ; CHECK: $x2 = COPY [[ZEXT]](s64)
112
+ ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
113
+ ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
114
+ ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[C1]], [[C]]
115
+ ; CHECK: $w3 = COPY [[AND]](s32)
116
+ ; CHECK: BL &memcpy, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit $w3
117
+ ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
118
+ ; CHECK: $x0 = COPY [[ZEXT]](s64)
119
+ ; CHECK: RET_ReallyLR implicit $x0
120
+ %0:_(p0) = COPY $x0
121
+ %1:_(p0) = COPY $x1
122
+ %2:_(s32) = COPY $w2
123
+ %4:_(s1) = G_CONSTANT i1 false
124
+ %3:_(s64) = G_ZEXT %2(s32)
125
+ G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.memcpy), %0(p0), %1(p0), %3(s64), %4(s1)
126
+ $x0 = COPY %3
127
+ RET_ReallyLR implicit $x0
128
+
129
+ ...
130
+ ---
131
+ name : dont_tc_twice
132
+ tracksRegLiveness : true
133
+ body : |
134
+ bb.1:
135
+ liveins: $w2, $x0, $x1
136
+ ; CHECK-LABEL: name: dont_tc_twice
137
+ ; CHECK: liveins: $w2, $x0, $x1
138
+ ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
139
+ ; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
140
+ ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
141
+ ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY2]](s32)
142
+ ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
143
+ ; CHECK: $x0 = COPY [[COPY]](p0)
144
+ ; CHECK: $x1 = COPY [[COPY1]](p0)
145
+ ; CHECK: $x2 = COPY [[ZEXT]](s64)
146
+ ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
147
+ ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
148
+ ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[C1]], [[C]]
149
+ ; CHECK: $w3 = COPY [[AND]](s32)
150
+ ; CHECK: BL &memcpy, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit $w3
151
+ ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
152
+ ; CHECK: TCRETURNdi &memset, 0, csr_aarch64_aapcs, implicit $sp
153
+ %0:_(p0) = COPY $x0
154
+ %1:_(p0) = COPY $x1
155
+ %2:_(s32) = COPY $w2
156
+ %4:_(s1) = G_CONSTANT i1 false
157
+ %3:_(s64) = G_ZEXT %2(s32)
158
+ G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.memcpy), %0(p0), %1(p0), %3(s64), %4(s1)
159
+ TCRETURNdi &memset, 0, csr_aarch64_aapcs, implicit $sp
0 commit comments