diff options
author | Reid Kleckner <reid@kleckner.net> | 2014-04-24 20:14:34 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2014-04-24 20:14:34 +0000 |
commit | 710c1a449dd7bee747ecf9c344a6f6d5461a158d (patch) | |
tree | 112a9b219c12b5a90996ac964c861b3526f25266 /lib/Target/ARM64/ARM64ISelLowering.cpp | |
parent | 870200a833584ca4e05f5d1258265451d8b871eb (diff) | |
download | llvm-710c1a449dd7bee747ecf9c344a6f6d5461a158d.tar.gz llvm-710c1a449dd7bee747ecf9c344a6f6d5461a158d.tar.bz2 llvm-710c1a449dd7bee747ecf9c344a6f6d5461a158d.tar.xz |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207143 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM64/ARM64ISelLowering.cpp')
-rw-r--r-- | lib/Target/ARM64/ARM64ISelLowering.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Target/ARM64/ARM64ISelLowering.cpp b/lib/Target/ARM64/ARM64ISelLowering.cpp index 154306c02b..58e425938e 100644 --- a/lib/Target/ARM64/ARM64ISelLowering.cpp +++ b/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? |