llvm.org GIT mirror llvm / 68c10a2
Remove variable_ops from call instructions in most targets. Call instructions are no longer required to be variadic, and variable_ops should only be used for instructions that encode a variable number of arguments, like the ARM stm/ldm instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160189 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 8 years ago
11 changed file(s) with 44 addition(s) and 46 deletion(s). Raw diff Collapse all Expand all
34203420 // Branch relative and set link: Used if we actually know that the target
34213421 // is within [-32768, 32767] bytes of the target
34223422 def BRSL:
3423 BranchSetLink<0b011001100, (outs), (ins relcalltarget:$func, variable_ops),
3423 BranchSetLink<0b011001100, (outs), (ins relcalltarget:$func),
34243424 "brsl\t$$lr, $func",
34253425 [(SPUcall (SPUpcrel tglobaladdr:$func, 0))]>;
34263426
34273427 // Branch absolute and set link: Used if we actually know that the target
34283428 // is an absolute address
34293429 def BRASL:
3430 BranchSetLink<0b011001100, (outs), (ins calltarget:$func, variable_ops),
3430 BranchSetLink<0b011001100, (outs), (ins calltarget:$func),
34313431 "brasl\t$$lr, $func",
34323432 [(SPUcall (SPUaform tglobaladdr:$func, 0))]>;
34333433
25652565 let isCall = 1, neverHasSideEffects = 1,
25662566 Defs = [D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10,
25672567 R22, R23, R28, R31, P0, P1, P2, P3, LC0, LC1, SA0, SA1] in {
2568 def CALL : JInst<(outs), (ins calltarget:$dst, variable_ops),
2568 def CALL : JInst<(outs), (ins calltarget:$dst),
25692569 "call $dst", []>;
25702570 }
25712571
25732573 let isCall = 1, neverHasSideEffects = 1,
25742574 Defs = [D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10,
25752575 R22, R23, R28, R31, P0, P1, P2, P3, LC0, LC1, SA0, SA1] in {
2576 def CALLR : JRInst<(outs), (ins IntRegs:$dst, variable_ops),
2576 def CALLR : JRInst<(outs), (ins IntRegs:$dst),
25772577 "callr $dst",
25782578 []>;
25792579 }
25822582 let isCall = 1, isBarrier = 1, isReturn = 1, isTerminator = 1,
25832583 Defs = [D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10,
25842584 R22, R23, R28, R31, P0, P1, P2, P3, LC0, LC1, SA0, SA1] in {
2585 def TCRETURNtg : JInst<(outs), (ins calltarget:$dst, variable_ops),
2585 def TCRETURNtg : JInst<(outs), (ins calltarget:$dst),
25862586 "jump $dst // TAILCALL", []>;
25872587 }
25882588 let isCall = 1, isBarrier = 1, isReturn = 1, isTerminator = 1,
25892589 Defs = [D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10,
25902590 R22, R23, R28, R31, P0, P1, P2, P3, LC0, LC1, SA0, SA1] in {
2591 def TCRETURNtext : JInst<(outs), (ins calltarget:$dst, variable_ops),
2591 def TCRETURNtext : JInst<(outs), (ins calltarget:$dst),
25922592 "jump $dst // TAILCALL", []>;
25932593 }
25942594
25952595 let isCall = 1, isBarrier = 1, isReturn = 1, isTerminator = 1,
25962596 Defs = [D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10,
25972597 R22, R23, R28, R31, P0, P1, P2, P3, LC0, LC1, SA0, SA1] in {
2598 def TCRETURNR : JInst<(outs), (ins IntRegs:$dst, variable_ops),
2598 def TCRETURNR : JInst<(outs), (ins IntRegs:$dst),
25992599 "jumpr $dst // TAILCALL", []>;
26002600 }
26012601 // Map call instruction.
1818 let isCall = 1, neverHasSideEffects = 1,
1919 Defs = [D0, D1, D2, D3, D4, D5, D6, D7, R28, R31,
2020 P0, P1, P2, P3, LC0, LC1, SA0, SA1] in {
21 def CALLv3 : JInst<(outs), (ins calltarget:$dst, variable_ops),
21 def CALLv3 : JInst<(outs), (ins calltarget:$dst),
2222 "call $dst", []>, Requires<[HasV3T]>;
2323 }
2424
3434 let isCall = 1, neverHasSideEffects = 1,
3535 Defs = [D0, D1, D2, D3, D4, D5, D6, D7, R28, R31,
3636 P0, P1, P2, P3, LC0, LC1, SA0, SA1] in {
37 def CALLRv3 : JRInst<(outs), (ins IntRegs:$dst, variable_ops),
37 def CALLRv3 : JRInst<(outs), (ins IntRegs:$dst),
3838 "callr $dst",
3939 []>, Requires<[HasV3TOnly]>;
4040 }
51555155 let isCall = 1, isBarrier = 1, isReturn = 1, isTerminator = 1,
51565156 Defs = [R29, R30, R31, PC] in {
51575157 def RESTORE_DEALLOC_RET_JMP_V4 : JInst<(outs),
5158 (ins calltarget:$dst, variable_ops),
5158 (ins calltarget:$dst),
51595159 "jump $dst // Restore_and_dealloc_return",
51605160 []>,
51615161 Requires<[HasV4T]>;
51655165 let isCall = 1, isBarrier = 1,
51665166 Defs = [R29, R30, R31, PC] in {
51675167 def RESTORE_DEALLOC_BEFORE_TAILCALL_V4 : JInst<(outs),
5168 (ins calltarget:$dst, variable_ops),
5168 (ins calltarget:$dst),
51695169 "call $dst // Restore_and_dealloc_before_tailcall",
51705170 []>,
51715171 Requires<[HasV4T]>;
51755175 let isCall = 1, isBarrier = 1,
51765176 Uses = [R29, R31] in {
51775177 def SAVE_REGISTERS_CALL_V4 : JInst<(outs),
5178 (ins calltarget:$dst, variable_ops),
5178 (ins calltarget:$dst),
51795179 "call $dst // Save_calle_saved_registers",
51805180 []>,
51815181 Requires<[HasV4T]>;
294294 // Branch and Link Instructions
295295 //===----------------------------------------------------------------------===//
296296 class BranchL op, bits<5> br, bits<11> flags, string instr_asm> :
297 TA, variable_ops),
297 TA),
298298 !strconcat(instr_asm, " $link, $target"),
299299 [], IIC_BRl> {
300300 let ra = br;
302302 }
303303
304304 class BranchLI op, bits<5> br, string instr_asm> :
305 TB, variable_ops),
305 TB),
306306 !strconcat(instr_asm, " $link, $target"),
307307 [], IIC_BRl> {
308308 let ra = br;
209209 let Defs = [R12W, R13W, R14W, R15W, SRW],
210210 Uses = [SPW] in {
211211 def CALLi : II16i<0x0,
212 (outs), (ins i16imm:$dst, variable_ops),
212 (outs), (ins i16imm:$dst),
213213 "call\t$dst", [(MSP430call imm:$dst)]>;
214214 def CALLr : II16r<0x0,
215 (outs), (ins GR16:$dst, variable_ops),
215 (outs), (ins GR16:$dst),
216216 "call\t$dst", [(MSP430call GR16:$dst)]>;
217217 def CALLm : II16m<0x0,
218 (outs), (ins memsrc:$dst, variable_ops),
218 (outs), (ins memsrc:$dst),
219219 "call\t${dst:mem}", [(MSP430call (load addr:$dst))]>;
220220 }
221221
4343 // Jump and Link (Call)
4444 let isCall=1, hasDelaySlot=1, nd=0, l=0, ra=0 in
4545 def JumpLinkReg16:
46 FRR16_JALRC<(outs), (ins CPU16Regs:$rs, variable_ops),
46 FRR16_JALRC<(outs), (ins CPU16Regs:$rs),
4747 "jalr \t$rs", [(MipsJmpLink CPU16Regs:$rs)], IIBranch>;
4848
4949 // Small immediates
648648 // Jump and Link (Call)
649649 let isCall=1, hasDelaySlot=1, Defs = [RA] in {
650650 class JumpLink op, string instr_asm>:
651 FJ, variable_ops),
651 FJ),
652652 !strconcat(instr_asm, "\t$target"), [(MipsJmpLink imm:$target)],
653653 IIBranch> {
654654 let DecoderMethod = "DecodeJumpTarget";
656656
657657 class JumpLinkReg op, bits<6> func, string instr_asm,
658658 RegisterClass RC>:
659 FR, variable_ops),
659 FR),
660660 !strconcat(instr_asm, "\t$rs"), [(MipsJmpLink RC:$rs)], IIBranch> {
661661 let rt = 0;
662662 let rd = 31;
664664 }
665665
666666 class BranchLink _rt, RegisterClass RC>:
667 FI<0x1, (outs), (ins RC:$rs, brtarget:$imm16, variable_ops),
667 FI<0x1, (outs), (ins RC:$rs, brtarget:$imm16),
668668 !strconcat(instr_asm, "\t$rs, $imm16"), [], IIBranch> {
669669 let rt = _rt;
670670 }
6767 // Convenient aliases for call instructions
6868 let Uses = [RM] in {
6969 def BL8_Darwin : IForm<18, 0, 1,
70 (outs), (ins calltarget:$func, variable_ops),
70 (outs), (ins calltarget:$func),
7171 "bl $func", BrB, []>; // See Pat patterns below.
7272 def BLA8_Darwin : IForm<18, 1, 1,
73 (outs), (ins aaddr:$func, variable_ops),
73 (outs), (ins aaddr:$func),
7474 "bla $func", BrB, [(PPCcall_Darwin (i64 imm:$func))]>;
7575 }
7676 let Uses = [CTR8, RM] in {
7777 def BCTRL8_Darwin : XLForm_2_ext<19, 528, 20, 0, 1,
78 (outs), (ins variable_ops),
78 (outs), (ins),
7979 "bctrl", BrB,
8080 [(PPCbctrl_Darwin)]>, Requires<[In64BitMode]>;
8181 }
8787 // Convenient aliases for call instructions
8888 let Uses = [RM] in {
8989 def BL8_ELF : IForm<18, 0, 1,
90 (outs), (ins calltarget:$func, variable_ops),
90 (outs), (ins calltarget:$func),
9191 "bl $func", BrB, []>; // See Pat patterns below.
9292
9393 let isCodeGenOnly = 1 in
9494 def BL8_NOP_ELF : IForm_and_DForm_4_zero<18, 0, 1, 24,
95 (outs), (ins calltarget:$func, variable_ops),
95 (outs), (ins calltarget:$func),
9696 "bl $func\n\tnop", BrB, []>;
9797
9898 def BLA8_ELF : IForm<18, 1, 1,
99 (outs), (ins aaddr:$func, variable_ops),
99 (outs), (ins aaddr:$func),
100100 "bla $func", BrB, [(PPCcall_SVR4 (i64 imm:$func))]>;
101101
102102 let isCodeGenOnly = 1 in
103103 def BLA8_NOP_ELF : IForm_and_DForm_4_zero<18, 1, 1, 24,
104 (outs), (ins aaddr:$func, variable_ops),
104 (outs), (ins aaddr:$func),
105105 "bla $func\n\tnop", BrB,
106106 [(PPCcall_nop_SVR4 (i64 imm:$func))]>;
107107 }
108108 let Uses = [X11, CTR8, RM] in {
109109 def BCTRL8_ELF : XLForm_2_ext<19, 528, 20, 0, 1,
110 (outs), (ins variable_ops),
110 (outs), (ins),
111111 "bctrl", BrB,
112112 [(PPCbctrl_SVR4)]>, Requires<[In64BitMode]>;
113113 }
179179
180180 let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, Uses = [RM] in
181181 def TCRETURNdi8 :Pseudo< (outs),
182 (ins calltarget:$dst, i32imm:$offset, variable_ops),
182 (ins calltarget:$dst, i32imm:$offset),
183183 "#TC_RETURNd8 $dst $offset",
184184 []>;
185185
186186 let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, Uses = [RM] in
187 def TCRETURNai8 :Pseudo<(outs), (ins aaddr:$func, i32imm:$offset, variable_ops),
187 def TCRETURNai8 :Pseudo<(outs), (ins aaddr:$func, i32imm:$offset),
188188 "#TC_RETURNa8 $func $offset",
189189 [(PPCtc_return (i64 imm:$func), imm:$offset)]>;
190190
191191 let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, Uses = [RM] in
192 def TCRETURNri8 : Pseudo<(outs), (ins CTRRC8:$dst, i32imm:$offset, variable_ops),
192 def TCRETURNri8 : Pseudo<(outs), (ins CTRRC8:$dst, i32imm:$offset),
193193 "#TC_RETURNr8 $dst $offset",
194194 []>;
195195
451451 // Convenient aliases for call instructions
452452 let Uses = [RM] in {
453453 def BL_Darwin : IForm<18, 0, 1,
454 (outs), (ins calltarget:$func, variable_ops),
454 (outs), (ins calltarget:$func),
455455 "bl $func", BrB, []>; // See Pat patterns below.
456456 def BLA_Darwin : IForm<18, 1, 1,
457 (outs), (ins aaddr:$func, variable_ops),
457 (outs), (ins aaddr:$func),
458458 "bla $func", BrB, [(PPCcall_Darwin (i32 imm:$func))]>;
459459 }
460460 let Uses = [CTR, RM] in {
461461 def BCTRL_Darwin : XLForm_2_ext<19, 528, 20, 0, 1,
462 (outs), (ins variable_ops),
462 (outs), (ins),
463463 "bctrl", BrB,
464464 [(PPCbctrl_Darwin)]>, Requires<[In32BitMode]>;
465465 }
470470 // Convenient aliases for call instructions
471471 let Uses = [RM] in {
472472 def BL_SVR4 : IForm<18, 0, 1,
473 (outs), (ins calltarget:$func, variable_ops),
473 (outs), (ins calltarget:$func),
474474 "bl $func", BrB, []>; // See Pat patterns below.
475475 def BLA_SVR4 : IForm<18, 1, 1,
476 (outs), (ins aaddr:$func, variable_ops),
476 (outs), (ins aaddr:$func),
477477 "bla $func", BrB,
478478 [(PPCcall_SVR4 (i32 imm:$func))]>;
479479 }
480480 let Uses = [CTR, RM] in {
481481 def BCTRL_SVR4 : XLForm_2_ext<19, 528, 20, 0, 1,
482 (outs), (ins variable_ops),
482 (outs), (ins),
483483 "bctrl", BrB,
484484 [(PPCbctrl_SVR4)]>, Requires<[In32BitMode]>;
485485 }
488488
489489 let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, Uses = [RM] in
490490 def TCRETURNdi :Pseudo< (outs),
491 (ins calltarget:$dst, i32imm:$offset, variable_ops),
491 (ins calltarget:$dst, i32imm:$offset),
492492 "#TC_RETURNd $dst $offset",
493493 []>;
494494
495495
496496 let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, Uses = [RM] in
497 def TCRETURNai :Pseudo<(outs), (ins aaddr:$func, i32imm:$offset, variable_ops),
497 def TCRETURNai :Pseudo<(outs), (ins aaddr:$func, i32imm:$offset),
498498 "#TC_RETURNa $func $offset",
499499 [(PPCtc_return (i32 imm:$func), imm:$offset)]>;
500500
501501 let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, Uses = [RM] in
502 def TCRETURNri : Pseudo<(outs), (ins CTRRC:$dst, i32imm:$offset, variable_ops),
502 def TCRETURNri : Pseudo<(outs), (ins CTRRC:$dst, i32imm:$offset),
503503 "#TC_RETURNr $dst $offset",
504504 []>;
505505
740740 // All calls clobber the link register and the non-callee-saved registers:
741741 Defs = [R0, R1, R2, R3, R11, LR], Uses = [SP] in {
742742 def BL_u10 : _FU10<
743 (outs),
744 (ins calltarget:$target, variable_ops),
743 (outs), (ins calltarget:$target),
745744 "bl $target",
746745 [(XCoreBranchLink immU10:$target)]>;
747746
748747 def BL_lu10 : _FLU10<
749 (outs),
750 (ins calltarget:$target, variable_ops),
748 (outs), (ins calltarget:$target),
751749 "bl $target",
752750 [(XCoreBranchLink immU20:$target)]>;
753751 }
987985 let isCall=1,
988986 // All calls clobber the link register and the non-callee-saved registers:
989987 Defs = [R0, R1, R2, R3, R11, LR], Uses = [SP] in {
990 def BLA_1r : _F1R<(outs), (ins GRRegs:$addr, variable_ops),
988 def BLA_1r : _F1R<(outs), (ins GRRegs:$addr),
991989 "bla $addr",
992990 [(XCoreBranchLink GRRegs:$addr)]>;
993991 }