1 //===-- X86InstrControl.td - Control Flow Instructions -----*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file describes the X86 jump, return, call, and related instructions.
11 //===----------------------------------------------------------------------===//
13 //===----------------------------------------------------------------------===//
14 // Control Flow Instructions.
17 // Return instructions.
19 // The X86retflag return instructions are variadic because we may add ST0 and
20 // ST1 arguments when returning values on the x87 stack.
21 let isTerminator = 1, isReturn = 1, isBarrier = 1,
22 hasCtrlDep = 1, FPForm = SpecialFP, SchedRW = [WriteJumpLd] in {
23 def RETL : I <0xC3, RawFrm, (outs), (ins variable_ops),
24 "ret{l}", []>, OpSize32, Requires<[Not64BitMode]>;
25 def RETQ : I <0xC3, RawFrm, (outs), (ins variable_ops),
26 "ret{q}", []>, OpSize32, Requires<[In64BitMode]>;
27 def RETW : I <0xC3, RawFrm, (outs), (ins),
28 "ret{w}", []>, OpSize16;
29 def RETIL : Ii16<0xC2, RawFrm, (outs), (ins i16imm:$amt, variable_ops),
30 "ret{l}\t$amt", []>, OpSize32, Requires<[Not64BitMode]>;
31 def RETIQ : Ii16<0xC2, RawFrm, (outs), (ins i16imm:$amt, variable_ops),
32 "ret{q}\t$amt", []>, OpSize32, Requires<[In64BitMode]>;
33 def RETIW : Ii16<0xC2, RawFrm, (outs), (ins i16imm:$amt),
34 "ret{w}\t$amt", []>, OpSize16;
35 def LRETL : I <0xCB, RawFrm, (outs), (ins),
36 "{l}ret{l|f}", []>, OpSize32;
37 def LRETQ : RI <0xCB, RawFrm, (outs), (ins),
38 "{l}ret{|f}q", []>, Requires<[In64BitMode]>;
39 def LRETW : I <0xCB, RawFrm, (outs), (ins),
40 "{l}ret{w|f}", []>, OpSize16;
41 def LRETIL : Ii16<0xCA, RawFrm, (outs), (ins i16imm:$amt),
42 "{l}ret{l|f}\t$amt", []>, OpSize32;
43 def LRETIQ : RIi16<0xCA, RawFrm, (outs), (ins i16imm:$amt),
44 "{l}ret{|f}q\t$amt", []>, Requires<[In64BitMode]>;
45 def LRETIW : Ii16<0xCA, RawFrm, (outs), (ins i16imm:$amt),
46 "{l}ret{w|f}\t$amt", []>, OpSize16;
48 // The machine return from interrupt instruction, but sometimes we need to
49 // perform a post-epilogue stack adjustment. Codegen emits the pseudo form
50 // which expands to include an SP adjustment if necessary.
51 def IRET16 : I <0xcf, RawFrm, (outs), (ins), "iret{w}", []>,
53 def IRET32 : I <0xcf, RawFrm, (outs), (ins), "iret{l|d}", []>, OpSize32;
54 def IRET64 : RI <0xcf, RawFrm, (outs), (ins), "iretq", []>, Requires<[In64BitMode]>;
55 let isCodeGenOnly = 1 in
56 def IRET : PseudoI<(outs), (ins i32imm:$adj), [(X86iret timm:$adj)]>;
57 def RET : PseudoI<(outs), (ins i32imm:$adj, variable_ops), [(X86retflag timm:$adj)]>;
60 // Unconditional branches.
61 let isBarrier = 1, isBranch = 1, isTerminator = 1, SchedRW = [WriteJump] in {
62 def JMP_1 : Ii8PCRel<0xEB, RawFrm, (outs), (ins brtarget8:$dst),
63 "jmp\t$dst", [(br bb:$dst)]>;
64 let hasSideEffects = 0, isCodeGenOnly = 1, ForceDisassemble = 1 in {
65 def JMP_2 : Ii16PCRel<0xE9, RawFrm, (outs), (ins brtarget16:$dst),
66 "jmp\t$dst", []>, OpSize16;
67 def JMP_4 : Ii32PCRel<0xE9, RawFrm, (outs), (ins brtarget32:$dst),
68 "jmp\t$dst", []>, OpSize32;
72 // Conditional Branches.
73 let isBranch = 1, isTerminator = 1, Uses = [EFLAGS], SchedRW = [WriteJump],
74 isCodeGenOnly = 1, ForceDisassemble = 1 in {
75 def JCC_1 : Ii8PCRel <0x70, AddCCFrm, (outs),
76 (ins brtarget8:$dst, ccode:$cond),
78 [(X86brcond bb:$dst, imm:$cond, EFLAGS)]>;
79 let hasSideEffects = 0 in {
80 def JCC_2 : Ii16PCRel<0x80, AddCCFrm, (outs),
81 (ins brtarget16:$dst, ccode:$cond),
84 def JCC_4 : Ii32PCRel<0x80, AddCCFrm, (outs),
85 (ins brtarget32:$dst, ccode:$cond),
91 def : InstAlias<"jo\t$dst", (JCC_1 brtarget8:$dst, 0), 0>;
92 def : InstAlias<"jno\t$dst", (JCC_1 brtarget8:$dst, 1), 0>;
93 def : InstAlias<"jb\t$dst", (JCC_1 brtarget8:$dst, 2), 0>;
94 def : InstAlias<"jae\t$dst", (JCC_1 brtarget8:$dst, 3), 0>;
95 def : InstAlias<"je\t$dst", (JCC_1 brtarget8:$dst, 4), 0>;
96 def : InstAlias<"jne\t$dst", (JCC_1 brtarget8:$dst, 5), 0>;
97 def : InstAlias<"jbe\t$dst", (JCC_1 brtarget8:$dst, 6), 0>;
98 def : InstAlias<"ja\t$dst", (JCC_1 brtarget8:$dst, 7), 0>;
99 def : InstAlias<"js\t$dst", (JCC_1 brtarget8:$dst, 8), 0>;
100 def : InstAlias<"jns\t$dst", (JCC_1 brtarget8:$dst, 9), 0>;
101 def : InstAlias<"jp\t$dst", (JCC_1 brtarget8:$dst, 10), 0>;
102 def : InstAlias<"jnp\t$dst", (JCC_1 brtarget8:$dst, 11), 0>;
103 def : InstAlias<"jl\t$dst", (JCC_1 brtarget8:$dst, 12), 0>;
104 def : InstAlias<"jge\t$dst", (JCC_1 brtarget8:$dst, 13), 0>;
105 def : InstAlias<"jle\t$dst", (JCC_1 brtarget8:$dst, 14), 0>;
106 def : InstAlias<"jg\t$dst", (JCC_1 brtarget8:$dst, 15), 0>;
108 // jcx/jecx/jrcx instructions.
109 let isBranch = 1, isTerminator = 1, hasSideEffects = 0, SchedRW = [WriteJump] in {
110 // These are the 32-bit versions of this instruction for the asmparser. In
111 // 32-bit mode, the address size prefix is jcxz and the unprefixed version is
114 def JCXZ : Ii8PCRel<0xE3, RawFrm, (outs), (ins brtarget8:$dst),
115 "jcxz\t$dst", []>, AdSize16, Requires<[Not64BitMode]>;
117 def JECXZ : Ii8PCRel<0xE3, RawFrm, (outs), (ins brtarget8:$dst),
118 "jecxz\t$dst", []>, AdSize32;
121 def JRCXZ : Ii8PCRel<0xE3, RawFrm, (outs), (ins brtarget8:$dst),
122 "jrcxz\t$dst", []>, AdSize64, Requires<[In64BitMode]>;
126 let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1 in {
127 def JMP16r : I<0xFF, MRM4r, (outs), (ins GR16:$dst), "jmp{w}\t{*}$dst",
128 [(brind GR16:$dst)]>, Requires<[Not64BitMode]>,
129 OpSize16, Sched<[WriteJump]>;
130 def JMP16m : I<0xFF, MRM4m, (outs), (ins i16mem:$dst), "jmp{w}\t{*}$dst",
131 [(brind (loadi16 addr:$dst))]>, Requires<[Not64BitMode]>,
132 OpSize16, Sched<[WriteJumpLd]>;
134 def JMP32r : I<0xFF, MRM4r, (outs), (ins GR32:$dst), "jmp{l}\t{*}$dst",
135 [(brind GR32:$dst)]>, Requires<[Not64BitMode]>,
136 OpSize32, Sched<[WriteJump]>;
137 def JMP32m : I<0xFF, MRM4m, (outs), (ins i32mem:$dst), "jmp{l}\t{*}$dst",
138 [(brind (loadi32 addr:$dst))]>, Requires<[Not64BitMode]>,
139 OpSize32, Sched<[WriteJumpLd]>;
141 def JMP64r : I<0xFF, MRM4r, (outs), (ins GR64:$dst), "jmp{q}\t{*}$dst",
142 [(brind GR64:$dst)]>, Requires<[In64BitMode]>,
144 def JMP64m : I<0xFF, MRM4m, (outs), (ins i64mem:$dst), "jmp{q}\t{*}$dst",
145 [(brind (loadi64 addr:$dst))]>, Requires<[In64BitMode]>,
146 Sched<[WriteJumpLd]>;
148 // Non-tracking jumps for IBT, use with caution.
149 let isCodeGenOnly = 1 in {
150 def JMP16r_NT : I<0xFF, MRM4r, (outs), (ins GR16 : $dst), "jmp{w}\t{*}$dst",
151 [(X86NoTrackBrind GR16 : $dst)]>, Requires<[Not64BitMode]>,
152 OpSize16, Sched<[WriteJump]>, NOTRACK;
154 def JMP16m_NT : I<0xFF, MRM4m, (outs), (ins i16mem : $dst), "jmp{w}\t{*}$dst",
155 [(X86NoTrackBrind (loadi16 addr : $dst))]>,
156 Requires<[Not64BitMode]>, OpSize16, Sched<[WriteJumpLd]>,
159 def JMP32r_NT : I<0xFF, MRM4r, (outs), (ins GR32 : $dst), "jmp{l}\t{*}$dst",
160 [(X86NoTrackBrind GR32 : $dst)]>, Requires<[Not64BitMode]>,
161 OpSize32, Sched<[WriteJump]>, NOTRACK;
162 def JMP32m_NT : I<0xFF, MRM4m, (outs), (ins i32mem : $dst), "jmp{l}\t{*}$dst",
163 [(X86NoTrackBrind (loadi32 addr : $dst))]>,
164 Requires<[Not64BitMode]>, OpSize32, Sched<[WriteJumpLd]>,
167 def JMP64r_NT : I<0xFF, MRM4r, (outs), (ins GR64 : $dst), "jmp{q}\t{*}$dst",
168 [(X86NoTrackBrind GR64 : $dst)]>, Requires<[In64BitMode]>,
169 Sched<[WriteJump]>, NOTRACK;
170 def JMP64m_NT : I<0xFF, MRM4m, (outs), (ins i64mem : $dst), "jmp{q}\t{*}$dst",
171 [(X86NoTrackBrind(loadi64 addr : $dst))]>,
172 Requires<[In64BitMode]>, Sched<[WriteJumpLd]>, NOTRACK;
175 let Predicates = [Not64BitMode], AsmVariantName = "att" in {
176 def FARJMP16i : Iseg16<0xEA, RawFrmImm16, (outs),
177 (ins i16imm:$off, i16imm:$seg),
178 "ljmp{w}\t$seg, $off", []>,
179 OpSize16, Sched<[WriteJump]>;
180 def FARJMP32i : Iseg32<0xEA, RawFrmImm16, (outs),
181 (ins i32imm:$off, i16imm:$seg),
182 "ljmp{l}\t$seg, $off", []>,
183 OpSize32, Sched<[WriteJump]>;
185 def FARJMP64 : RI<0xFF, MRM5m, (outs), (ins opaquemem:$dst),
186 "ljmp{q}\t{*}$dst", []>, Sched<[WriteJump]>, Requires<[In64BitMode]>;
188 let AsmVariantName = "att" in
189 def FARJMP16m : I<0xFF, MRM5m, (outs), (ins opaquemem:$dst),
190 "ljmp{w}\t{*}$dst", []>, OpSize16, Sched<[WriteJumpLd]>;
191 def FARJMP32m : I<0xFF, MRM5m, (outs), (ins opaquemem:$dst),
192 "{l}jmp{l}\t{*}$dst", []>, OpSize32, Sched<[WriteJumpLd]>;
196 let SchedRW = [WriteJump] in {
197 def LOOP : Ii8PCRel<0xE2, RawFrm, (outs), (ins brtarget8:$dst), "loop\t$dst", []>;
198 def LOOPE : Ii8PCRel<0xE1, RawFrm, (outs), (ins brtarget8:$dst), "loope\t$dst", []>;
199 def LOOPNE : Ii8PCRel<0xE0, RawFrm, (outs), (ins brtarget8:$dst), "loopne\t$dst", []>;
202 //===----------------------------------------------------------------------===//
203 // Call Instructions...
206 // All calls clobber the non-callee saved registers. ESP is marked as
207 // a use to prevent stack-pointer assignments that appear immediately
208 // before calls from potentially appearing dead. Uses for argument
209 // registers are added manually.
210 let Uses = [ESP, SSP] in {
211 def CALLpcrel32 : Ii32PCRel<0xE8, RawFrm,
212 (outs), (ins i32imm_pcrel:$dst),
213 "call{l}\t$dst", []>, OpSize32,
214 Requires<[Not64BitMode]>, Sched<[WriteJump]>;
215 let hasSideEffects = 0 in
216 def CALLpcrel16 : Ii16PCRel<0xE8, RawFrm,
217 (outs), (ins i16imm_pcrel:$dst),
218 "call{w}\t$dst", []>, OpSize16,
220 def CALL16r : I<0xFF, MRM2r, (outs), (ins GR16:$dst),
221 "call{w}\t{*}$dst", [(X86call GR16:$dst)]>,
222 OpSize16, Requires<[Not64BitMode]>, Sched<[WriteJump]>;
223 def CALL16m : I<0xFF, MRM2m, (outs), (ins i16mem:$dst),
224 "call{w}\t{*}$dst", [(X86call (loadi16 addr:$dst))]>,
225 OpSize16, Requires<[Not64BitMode,FavorMemIndirectCall]>,
226 Sched<[WriteJumpLd]>;
227 def CALL32r : I<0xFF, MRM2r, (outs), (ins GR32:$dst),
228 "call{l}\t{*}$dst", [(X86call GR32:$dst)]>, OpSize32,
229 Requires<[Not64BitMode,NotUseRetpolineIndirectCalls]>,
231 def CALL32m : I<0xFF, MRM2m, (outs), (ins i32mem:$dst),
232 "call{l}\t{*}$dst", [(X86call (loadi32 addr:$dst))]>,
234 Requires<[Not64BitMode,FavorMemIndirectCall,
235 NotUseRetpolineIndirectCalls]>,
236 Sched<[WriteJumpLd]>;
238 // Non-tracking calls for IBT, use with caution.
239 let isCodeGenOnly = 1 in {
240 def CALL16r_NT : I<0xFF, MRM2r, (outs), (ins GR16 : $dst),
241 "call{w}\t{*}$dst",[(X86NoTrackCall GR16 : $dst)]>,
242 OpSize16, Requires<[Not64BitMode]>, Sched<[WriteJump]>, NOTRACK;
243 def CALL16m_NT : I<0xFF, MRM2m, (outs), (ins i16mem : $dst),
244 "call{w}\t{*}$dst",[(X86NoTrackCall(loadi16 addr : $dst))]>,
245 OpSize16, Requires<[Not64BitMode,FavorMemIndirectCall]>,
246 Sched<[WriteJumpLd]>, NOTRACK;
247 def CALL32r_NT : I<0xFF, MRM2r, (outs), (ins GR32 : $dst),
248 "call{l}\t{*}$dst",[(X86NoTrackCall GR32 : $dst)]>,
249 OpSize32, Requires<[Not64BitMode]>, Sched<[WriteJump]>, NOTRACK;
250 def CALL32m_NT : I<0xFF, MRM2m, (outs), (ins i32mem : $dst),
251 "call{l}\t{*}$dst",[(X86NoTrackCall(loadi32 addr : $dst))]>,
252 OpSize32, Requires<[Not64BitMode,FavorMemIndirectCall]>,
253 Sched<[WriteJumpLd]>, NOTRACK;
256 let Predicates = [Not64BitMode], AsmVariantName = "att" in {
257 def FARCALL16i : Iseg16<0x9A, RawFrmImm16, (outs),
258 (ins i16imm:$off, i16imm:$seg),
259 "lcall{w}\t$seg, $off", []>,
260 OpSize16, Sched<[WriteJump]>;
261 def FARCALL32i : Iseg32<0x9A, RawFrmImm16, (outs),
262 (ins i32imm:$off, i16imm:$seg),
263 "lcall{l}\t$seg, $off", []>,
264 OpSize32, Sched<[WriteJump]>;
267 def FARCALL16m : I<0xFF, MRM3m, (outs), (ins opaquemem:$dst),
268 "lcall{w}\t{*}$dst", []>, OpSize16, Sched<[WriteJumpLd]>;
269 def FARCALL32m : I<0xFF, MRM3m, (outs), (ins opaquemem:$dst),
270 "{l}call{l}\t{*}$dst", []>, OpSize32, Sched<[WriteJumpLd]>;
275 let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1,
276 isCodeGenOnly = 1, Uses = [ESP, SSP] in {
277 def TCRETURNdi : PseudoI<(outs), (ins i32imm_pcrel:$dst, i32imm:$offset),
278 []>, Sched<[WriteJump]>, NotMemoryFoldable;
279 def TCRETURNri : PseudoI<(outs), (ins ptr_rc_tailcall:$dst, i32imm:$offset),
280 []>, Sched<[WriteJump]>, NotMemoryFoldable;
282 def TCRETURNmi : PseudoI<(outs), (ins i32mem_TC:$dst, i32imm:$offset),
283 []>, Sched<[WriteJumpLd]>;
285 // FIXME: The should be pseudo instructions that are lowered when going to
287 def TAILJMPd : Ii32PCRel<0xE9, RawFrm, (outs), (ins i32imm_pcrel:$dst),
288 "jmp\t$dst", []>, Sched<[WriteJump]>;
290 def TAILJMPr : I<0xFF, MRM4r, (outs), (ins ptr_rc_tailcall:$dst),
291 "", []>, Sched<[WriteJump]>; // FIXME: Remove encoding when JIT is dead.
293 def TAILJMPm : I<0xFF, MRM4m, (outs), (ins i32mem_TC:$dst),
294 "jmp{l}\t{*}$dst", []>, Sched<[WriteJumpLd]>;
297 // Conditional tail calls are similar to the above, but they are branches
298 // rather than barriers, and they use EFLAGS.
299 let isCall = 1, isTerminator = 1, isReturn = 1, isBranch = 1,
300 isCodeGenOnly = 1, SchedRW = [WriteJump] in
301 let Uses = [ESP, EFLAGS, SSP] in {
302 def TCRETURNdicc : PseudoI<(outs),
303 (ins i32imm_pcrel:$dst, i32imm:$offset, i32imm:$cond), []>;
305 // This gets substituted to a conditional jump instruction in MC lowering.
306 def TAILJMPd_CC : Ii32PCRel<0x80, RawFrm, (outs),
307 (ins i32imm_pcrel:$dst, i32imm:$cond), "", []>;
311 //===----------------------------------------------------------------------===//
312 // Call Instructions...
315 // RSP is marked as a use to prevent stack-pointer assignments that appear
316 // immediately before calls from potentially appearing dead. Uses for argument
317 // registers are added manually.
318 let isCall = 1, Uses = [RSP, SSP], SchedRW = [WriteJump] in {
319 // NOTE: this pattern doesn't match "X86call imm", because we do not know
320 // that the offset between an arbitrary immediate and the call will fit in
321 // the 32-bit pcrel field that we have.
322 def CALL64pcrel32 : Ii32PCRel<0xE8, RawFrm,
323 (outs), (ins i64i32imm_pcrel:$dst),
324 "call{q}\t$dst", []>, OpSize32,
325 Requires<[In64BitMode]>;
326 def CALL64r : I<0xFF, MRM2r, (outs), (ins GR64:$dst),
327 "call{q}\t{*}$dst", [(X86call GR64:$dst)]>,
328 Requires<[In64BitMode,NotUseRetpolineIndirectCalls]>;
329 def CALL64m : I<0xFF, MRM2m, (outs), (ins i64mem:$dst),
330 "call{q}\t{*}$dst", [(X86call (loadi64 addr:$dst))]>,
331 Requires<[In64BitMode,FavorMemIndirectCall,
332 NotUseRetpolineIndirectCalls]>;
334 // Non-tracking calls for IBT, use with caution.
335 let isCodeGenOnly = 1 in {
336 def CALL64r_NT : I<0xFF, MRM2r, (outs), (ins GR64 : $dst),
337 "call{q}\t{*}$dst",[(X86NoTrackCall GR64 : $dst)]>,
338 Requires<[In64BitMode]>, NOTRACK;
339 def CALL64m_NT : I<0xFF, MRM2m, (outs), (ins i64mem : $dst),
341 [(X86NoTrackCall(loadi64 addr : $dst))]>,
342 Requires<[In64BitMode,FavorMemIndirectCall]>, NOTRACK;
345 def FARCALL64 : RI<0xFF, MRM3m, (outs), (ins opaquemem:$dst),
346 "lcall{q}\t{*}$dst", []>;
349 let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1,
350 isCodeGenOnly = 1, Uses = [RSP, SSP] in {
351 def TCRETURNdi64 : PseudoI<(outs),
352 (ins i64i32imm_pcrel:$dst, i32imm:$offset),
353 []>, Sched<[WriteJump]>;
354 def TCRETURNri64 : PseudoI<(outs),
355 (ins ptr_rc_tailcall:$dst, i32imm:$offset),
356 []>, Sched<[WriteJump]>, NotMemoryFoldable;
358 def TCRETURNmi64 : PseudoI<(outs),
359 (ins i64mem_TC:$dst, i32imm:$offset),
360 []>, Sched<[WriteJumpLd]>, NotMemoryFoldable;
362 def TAILJMPd64 : Ii32PCRel<0xE9, RawFrm, (outs), (ins i64i32imm_pcrel:$dst),
363 "jmp\t$dst", []>, Sched<[WriteJump]>;
365 def TAILJMPr64 : I<0xFF, MRM4r, (outs), (ins ptr_rc_tailcall:$dst),
366 "jmp{q}\t{*}$dst", []>, Sched<[WriteJump]>;
369 def TAILJMPm64 : I<0xFF, MRM4m, (outs), (ins i64mem_TC:$dst),
370 "jmp{q}\t{*}$dst", []>, Sched<[WriteJumpLd]>;
372 // Win64 wants indirect jumps leaving the function to have a REX_W prefix.
373 let hasREX_WPrefix = 1 in {
374 def TAILJMPr64_REX : I<0xFF, MRM4r, (outs), (ins ptr_rc_tailcall:$dst),
375 "rex64 jmp{q}\t{*}$dst", []>, Sched<[WriteJump]>;
378 def TAILJMPm64_REX : I<0xFF, MRM4m, (outs), (ins i64mem_TC:$dst),
379 "rex64 jmp{q}\t{*}$dst", []>, Sched<[WriteJumpLd]>;
383 let isPseudo = 1, isCall = 1, isCodeGenOnly = 1,
385 usesCustomInserter = 1,
386 SchedRW = [WriteJump] in {
387 def RETPOLINE_CALL32 :
388 PseudoI<(outs), (ins GR32:$dst), [(X86call GR32:$dst)]>,
389 Requires<[Not64BitMode,UseRetpolineIndirectCalls]>;
391 def RETPOLINE_CALL64 :
392 PseudoI<(outs), (ins GR64:$dst), [(X86call GR64:$dst)]>,
393 Requires<[In64BitMode,UseRetpolineIndirectCalls]>;
395 // Retpoline variant of indirect tail calls.
396 let isTerminator = 1, isReturn = 1, isBarrier = 1 in {
397 def RETPOLINE_TCRETURN64 :
398 PseudoI<(outs), (ins GR64:$dst, i32imm:$offset), []>;
399 def RETPOLINE_TCRETURN32 :
400 PseudoI<(outs), (ins GR32:$dst, i32imm:$offset), []>;
404 // Conditional tail calls are similar to the above, but they are branches
405 // rather than barriers, and they use EFLAGS.
406 let isCall = 1, isTerminator = 1, isReturn = 1, isBranch = 1,
407 isCodeGenOnly = 1, SchedRW = [WriteJump] in
408 let Uses = [RSP, EFLAGS, SSP] in {
409 def TCRETURNdi64cc : PseudoI<(outs),
410 (ins i64i32imm_pcrel:$dst, i32imm:$offset,
413 // This gets substituted to a conditional jump instruction in MC lowering.
414 def TAILJMPd64_CC : Ii32PCRel<0x80, RawFrm, (outs),
415 (ins i64i32imm_pcrel:$dst, i32imm:$cond), "", []>;