diff options
author | Dan Gohman <dan433584@gmail.com> | 2015-10-02 20:54:23 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2015-10-02 20:54:23 +0000 |
commit | 9cc692b06ef88a92dfebac3115926a84cb436134 (patch) | |
tree | e19b46153ad85557bdf8ddae89aa7f37070cc7be /llvm/lib/Target/WebAssembly | |
parent | e0129e474da7feb61806cd7fc1552143368e1996 (diff) | |
download | bcm5719-llvm-9cc692b06ef88a92dfebac3115926a84cb436134.tar.gz bcm5719-llvm-9cc692b06ef88a92dfebac3115926a84cb436134.zip |
[WebAssembly] Support calls marked as "tail", fastcc, and coldcc.
llvm-svn: 249184
Diffstat (limited to 'llvm/lib/Target/WebAssembly')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index c9be0b3f2df..475d13ceefa 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp @@ -229,13 +229,23 @@ WebAssemblyTargetLowering::LowerCall(CallLoweringInfo &CLI, MachineFunction &MF = DAG.getMachineFunction(); CallingConv::ID CallConv = CLI.CallConv; - if (CallConv != CallingConv::C) - fail(DL, DAG, "WebAssembly doesn't support non-C calling conventions"); - if (CLI.IsTailCall || MF.getTarget().Options.GuaranteedTailCallOpt) - fail(DL, DAG, "WebAssembly doesn't support tail call yet"); + if (CallConv != CallingConv::C && + CallConv != CallingConv::Fast && + CallConv != CallingConv::Cold) + fail(DL, DAG, + "WebAssembly doesn't support language-specific or target-specific " + "calling conventions yet"); if (CLI.IsPatchPoint) fail(DL, DAG, "WebAssembly doesn't support patch point yet"); + // WebAssembly doesn't currently support explicit tail calls. If they are + // required, fail. Otherwise, just disable them. + if ((CallConv == CallingConv::Fast && CLI.IsTailCall && + MF.getTarget().Options.GuaranteedTailCallOpt) || + (CLI.CS && CLI.CS->isMustTailCall())) + fail(DL, DAG, "WebAssembly doesn't support tail call yet"); + CLI.IsTailCall = false; + SmallVectorImpl<ISD::OutputArg> &Outs = CLI.Outs; SmallVectorImpl<SDValue> &OutVals = CLI.OutVals; |