mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-15 09:33:39 +00:00
Make x86 isel lowering produce tailcall nodes. They are match to normal calls
for now. Patch contributed by Alexander Friedman. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27994 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
43824e8216
commit
fea89c14ec
@ -1203,7 +1203,7 @@ X86TargetLowering::LowerFastCCCallTo(SDOperand Chain, const Type *RetTy,
|
||||
Ops.push_back(InFlag);
|
||||
|
||||
// FIXME: Do not generate X86ISD::TAILCALL for now.
|
||||
Chain = DAG.getNode(X86ISD::CALL, NodeTys, Ops);
|
||||
Chain = DAG.getNode(isTailCall ? X86ISD::TAILCALL : X86ISD::CALL, NodeTys, Ops);
|
||||
InFlag = Chain.getValue(1);
|
||||
|
||||
NodeTys.clear();
|
||||
|
@ -75,6 +75,9 @@ def X86callseq_end :
|
||||
def X86call : SDNode<"X86ISD::CALL", SDT_X86Call,
|
||||
[SDNPHasChain, SDNPOutFlag, SDNPOptInFlag]>;
|
||||
|
||||
def X86tailcall : SDNode<"X86ISD::TAILCALL", SDT_X86Call,
|
||||
[SDNPHasChain, SDNPOutFlag, SDNPOptInFlag]>;
|
||||
|
||||
def X86rep_stos: SDNode<"X86ISD::REP_STOS", SDTX86RepStr,
|
||||
[SDNPHasChain, SDNPInFlag, SDNPOutFlag]>;
|
||||
def X86rep_movs: SDNode<"X86ISD::REP_MOVS", SDTX86RepStr,
|
||||
@ -2329,6 +2332,19 @@ def : Pat<(store (X86Wrapper texternalsym:$src), addr:$dst),
|
||||
(MOV32mi addr:$dst, texternalsym:$src)>;
|
||||
|
||||
// Calls
|
||||
def : Pat<(X86tailcall R32:$dst),
|
||||
(CALL32r R32:$dst)>;
|
||||
|
||||
def : Pat<(X86tailcall (loadi32 addr:$dst)),
|
||||
(CALL32m addr:$dst)>;
|
||||
|
||||
def : Pat<(X86tailcall tglobaladdr:$dst),
|
||||
(CALLpcrel32 tglobaladdr:$dst)>;
|
||||
def : Pat<(X86tailcall texternalsym:$dst),
|
||||
(CALLpcrel32 texternalsym:$dst)>;
|
||||
|
||||
|
||||
|
||||
def : Pat<(X86call tglobaladdr:$dst),
|
||||
(CALLpcrel32 tglobaladdr:$dst)>;
|
||||
def : Pat<(X86call texternalsym:$dst),
|
||||
|
Loading…
x
Reference in New Issue
Block a user