[Diffusion] rL361590: Clarify how musttail can be used to create forwarding thunks

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 18:27:52 PDT 2019


rnk marked 2 inline comments as done.
rnk added inline comments.

/llvm/trunk/docs/LangRef.rst:10013 I'll add something.

Why should we make it illegal for thunks to call va_start? I think as long as the registers and memory get forwarded, the thunk can examine the variadic arguments.
/llvm/trunk/docs/LangRef.rst:10018 > It's not clear what we expect to happen for musttail calls which are varargs, but not in a function marked "thunk". Is it legal to pass any varargs arguments? (I guess no, because we couldn't lower it in general.) If not, what happens if the callee calls va_start? Does it get variadic arguments from the caller's caller?

I think we mainly added `"thunk"` to stop instcombine from messing things up when it could devirtualize and see the return value types. In the backend, we don't look at the "thunk" attribute at all.

Users:
  rnk (Author)

https://reviews.llvm.org/rL361590





More information about the llvm-commits mailing list