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 | 5772b77789728e045ccd8c93d79820632e81c4e6 (patch) | |
| tree | 6f4029a3081e1f1e6a0f9e9576737c5506e59bd1 /llvm/lib/Target/X86/X86ISelLowering.cpp | |
| parent | 0fbb1e91e57829d277bbea3ef1402ee7bc871dea (diff) | |
| download | bcm5719-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/X86/X86ISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 936699e9b59..8800bff87f8 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -2544,6 +2544,10 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, MF.getFunction()->hasStructRetAttr(), CLI.RetTy, 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"); + // Sibcalls are automatically detected tailcalls which do not require // ABI changes. if (!MF.getTarget().Options.GuaranteedTailCallOpt && isTailCall) |

