diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2012-10-19 21:14:34 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2012-10-19 21:14:34 +0000 |
commit | d03d68a3ba367d051bca7edce9da45a63a8ef1c9 (patch) | |
tree | 4e5a5ada83425f42e5b34405356a761a79041a1f /llvm | |
parent | 0c5e357d87af81fb60592266b0758edda3602b5c (diff) | |
download | bcm5719-llvm-d03d68a3ba367d051bca7edce9da45a63a8ef1c9.tar.gz bcm5719-llvm-d03d68a3ba367d051bca7edce9da45a63a8ef1c9.zip |
[mips] Add tail call instructions.
llvm-svn: 166338
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Target/Mips/Mips64InstrInfo.td | 1 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MipsInstrInfo.td | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/Mips64InstrInfo.td b/llvm/lib/Target/Mips/Mips64InstrInfo.td index 99a9f25abd2..ed0ea0e849a 100644 --- a/llvm/lib/Target/Mips/Mips64InstrInfo.td +++ b/llvm/lib/Target/Mips/Mips64InstrInfo.td @@ -177,6 +177,7 @@ def BLTZ64 : CBranchZero<0x01, 0, "bltz", setlt, CPU64Regs>; } let DecoderNamespace = "Mips64" in def JALR64 : JumpLinkReg<0x00, 0x09, "jalr", CPU64Regs>; +def TAILCALL64_R : JumpFR<CPU64Regs, MipsTailCall>, IsTailCall; let DecoderNamespace = "Mips64" in { /// Multiply and Divide Instructions. diff --git a/llvm/lib/Target/Mips/MipsInstrInfo.td b/llvm/lib/Target/Mips/MipsInstrInfo.td index f4fd8913d01..82a15efa46b 100644 --- a/llvm/lib/Target/Mips/MipsInstrInfo.td +++ b/llvm/lib/Target/Mips/MipsInstrInfo.td @@ -191,6 +191,15 @@ class IsCall { bit isCall = 1; } +class IsTailCall { + bit isCall = 1; + bit isTerminator = 1; + bit isReturn = 1; + bit isBarrier = 1; + bit hasExtraSrcRegAllocReq = 1; + bit isCodeGenOnly = 1; +} + //===----------------------------------------------------------------------===// // Instruction format superclass //===----------------------------------------------------------------------===// @@ -1013,6 +1022,8 @@ def JAL : JumpLink<0x03, "jal">; def JALR : JumpLinkReg<0x00, 0x09, "jalr", CPURegs>; def BGEZAL : BranchLink<"bgezal", 0x11, CPURegs>; def BLTZAL : BranchLink<"bltzal", 0x10, CPURegs>; +def TAILCALL : JumpFJ<0x02, "j", br>, IsTailCall; +def TAILCALL_R : JumpFR<CPURegs, MipsTailCall>, IsTailCall; def RET : RetBase<CPURegs>; |