diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-11-30 23:55:39 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-11-30 23:55:39 +0000 |
commit | 3d2125c9dbac695c93f42c0f59fd040e413fd711 (patch) | |
tree | 1f7e426fb325a457b03fafbc84f4f6446af3c270 /include | |
parent | 3f8c110dc643847363686d543a56c23c41353ab0 (diff) | |
download | external_llvm-3d2125c9dbac695c93f42c0f59fd040e413fd711.zip external_llvm-3d2125c9dbac695c93f42c0f59fd040e413fd711.tar.gz external_llvm-3d2125c9dbac695c93f42c0f59fd040e413fd711.tar.bz2 |
Enable sibling call optimization of libcalls which are expanded during
legalization time. Since at legalization time there is no mapping from
SDNode back to the corresponding LLVM instruction and the return
SDNode is target specific, this requires a target hook to check for
eligibility. Only x86 and ARM support this form of sibcall optimization
right now.
rdar://8707777
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120501 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/Analysis.h | 7 | ||||
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/Analysis.h b/include/llvm/CodeGen/Analysis.h index a8292ea..78bf9fc 100644 --- a/include/llvm/CodeGen/Analysis.h +++ b/include/llvm/CodeGen/Analysis.h @@ -23,8 +23,10 @@ namespace llvm { -class TargetLowering; class GlobalVariable; +class TargetLowering; +class SDNode; +class SelectionDAG; /// ComputeLinearIndex - Given an LLVM IR aggregate type and a sequence /// of insertvalue or extractvalue indices that identify a member, return @@ -75,6 +77,9 @@ ISD::CondCode getICmpCondCode(ICmpInst::Predicate Pred); bool isInTailCallPosition(ImmutableCallSite CS, Attributes CalleeRetAttr, const TargetLowering &TLI); +bool isInTailCallPosition(SelectionDAG &DAG, SDNode *Node, + const TargetLowering &TLI); + } // End llvm namespace #endif diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index b450f42..51925bd 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -1258,6 +1258,13 @@ public: return SDValue(); // this is here to silence compiler errors } + /// isUsedByReturnOnly - Return true if result of the specified node is used + /// by a return node only. This is used to determine whether it is possible + /// to codegen a libcall as tail call at legalization time. + virtual bool isUsedByReturnOnly(SDNode *N) const { + return false; + } + /// LowerOperationWrapper - This callback is invoked by the type legalizer /// to legalize nodes with an illegal operand type but legal result types. /// It replaces the LowerOperation callback in the type Legalizer. |