[llvm-dev] Setting llvm::TargetOptions::GuaranteedTailCallOpt in LTO Code Generation

Dwight Guth via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 18 14:02:37 PDT 2019


On Wed, Sep 18, 2019 at 3:32 PM Eli Friedman <efriedma at quicinc.com> wrote:

> We could extend the circumstances under which we allow musttail, sure.
> But we could only allow arbitrary mismatched argument lists with specific
> calling conventions where we know it’s actually possible to lower them.
> And currently, there is no such convention. (Well, technically there’s
> x86_stdcall, but that only works on 32-bit x86.  And the GHC and HiPE
> calling conventions are weird in other ways.)
>
>
>
> We could add a new calling convention that’s equivalent to “fastcc with
> GuaranteedTailCallOpt”, though, and give it special musttail rules.  Maybe
> call it “tailcc”.
>
>
>
> -Eli
>

What you suggest (a new tail-callable calling convention equivalent to
fastcc with GuaranteedTailCallOpt) sounds like a solution that would work
for us. But it also sounds like something significant enough in scope that
it might be difficult for me to complete myself, when I am barely familiar
with the codebase. I feel confident I could probably add a new function
attribute that is equivalent to specifying GuaranteedTailCallOpt=true if it
is present on both the callee and caller functions, but I doubt I have the
skills necessary to create an entirely new calling convention AND modify
the musttail semantics to have knowledge of it. Is this something someone
would actually be willing to work on or at the very least help me figure
out? Or is the former solution also considered viable?
-- 

Dwight Guth

Director of Engineering

Email: dwight.guth at runtimeverification.com

<https://www.runtimeverification.com>

<https://github.com/dwightguth> <https://www.linkedin.com/company/3142238/>
  <https://twitter.com/rv_inc>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190918/f2af15d1/attachment.html>


More information about the llvm-dev mailing list