summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM64
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-04-24 20:14:34 +0000
committerReid Kleckner <reid@kleckner.net>2014-04-24 20:14:34 +0000
commit5772b77789728e045ccd8c93d79820632e81c4e6 (patch)
tree6f4029a3081e1f1e6a0f9e9576737c5506e59bd1 /llvm/lib/Target/ARM64
parent0fbb1e91e57829d277bbea3ef1402ee7bc871dea (diff)
downloadbcm5719-llvm-5772b77789728e045ccd8c93d79820632e81c4e6.tar.gz
bcm5719-llvm-5772b77789728e045ccd8c93d79820632e81c4e6.zip
Add 'musttail' marker to call instructions
This is similar to the 'tail' marker, except that it guarantees that tail call optimization will occur. It also comes with convervative IR verification rules that ensure that tail call optimization is possible. Reviewers: nicholas Differential Revision: http://llvm-reviews.chandlerc.com/D3240 llvm-svn: 207143
Diffstat (limited to 'llvm/lib/Target/ARM64')
-rw-r--r--llvm/lib/Target/ARM64/ARM64ISelLowering.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM64/ARM64ISelLowering.cpp b/llvm/lib/Target/ARM64/ARM64ISelLowering.cpp
index 154306c02be..58e425938e1 100644
--- a/llvm/lib/Target/ARM64/ARM64ISelLowering.cpp
+++ b/llvm/lib/Target/ARM64/ARM64ISelLowering.cpp
@@ -1957,6 +1957,9 @@ SDValue ARM64TargetLowering::LowerCall(CallLoweringInfo &CLI,
IsTailCall = isEligibleForTailCallOptimization(
Callee, CallConv, IsVarArg, IsStructRet,
MF.getFunction()->hasStructRetAttr(), Outs, OutVals, Ins, DAG);
+ if (!IsTailCall && CLI.CS && CLI.CS->isMustTailCall())
+ report_fatal_error("failed to perform tail call elimination on a call "
+ "site marked musttail");
// We don't support GuaranteedTailCallOpt, only automatically
// detected sibcalls.
// FIXME: Re-evaluate. Is this true? Should it be true?
OpenPOWER on IntegriCloud