summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-15 03:10:37 +0000
committerChris Lattner <sabre@nondot.org>2005-05-15 03:10:37 +0000
commit1e9448bce8ca7078049c0fd07826945aea75d36c (patch)
tree82482b1ec61b0944976a1b20b8c6b2690326f886 /lib
parent4fc997941dde5c11e91a28c9b5b8fa331d053a18 (diff)
downloadllvm-1e9448bce8ca7078049c0fd07826945aea75d36c.tar.gz
llvm-1e9448bce8ca7078049c0fd07826945aea75d36c.tar.bz2
llvm-1e9448bce8ca7078049c0fd07826945aea75d36c.tar.xz
Add markers in the asm file for tail calls, add a new ADJSTACKPTRri
sorta-pseudo-instruction git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22042 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86InstrInfo.td18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td
index 5a6e62e520..e4cf12e858 100644
--- a/lib/Target/X86/X86InstrInfo.td
+++ b/lib/Target/X86/X86InstrInfo.td
@@ -191,13 +191,23 @@ let isCall = 1 in
def CALL32m : I<0xFF, MRM2m, (ops i32mem:$dst), "call {*}$dst">;
}
+// Tail call stuff.
let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
- def TAILJMPd : IBr<0xE9, (ops calltarget:$dst), "jmp $dst">;
+ def TAILJMPd : IBr<0xE9, (ops calltarget:$dst), "jmp $dst # TAIL CALL">;
let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
- def TAILJMPr : I<0xFF, MRM4r, (ops R32:$dst), "jmp {*}$dst">;
+ def TAILJMPr : I<0xFF, MRM4r, (ops R32:$dst), "jmp {*}$dst # TAIL CALL">;
let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in
- def TAILJMPm : I<0xFF, MRM4m, (ops i32mem:$dst), "jmp {*}$dst">;
-
+ def TAILJMPm : I<0xFF, MRM4m, (ops i32mem:$dst), "jmp {*}$dst # TAIL CALL">;
+
+// ADJSTACKPTRri - This is a standard ADD32ri instruction, identical in every
+// way, except that it is marked as being a terminator. This causes the epilog
+// inserter to insert reloads of callee saved registers BEFORE this. We need
+// this until we have a more accurate way of tracking where the stack pointer is
+// within a function.
+let isTerminator = 1, isTwoAddress = 1 in
+ def ADJSTACKPTRri : Ii32<0x81, MRM0r, (ops R32:$dst, R32:$src1, i32imm:$src2),
+ "add{l} {$src2, $dst|$dst, $src2}">;
+
//===----------------------------------------------------------------------===//
// Miscellaneous Instructions...
//