[PATCH] D105807: [X86] pr51000 struct return tailcalling

Nathan Sidwell via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 12 08:00:09 PDT 2021


urnathan added a comment.



> Quick question, when the backend disables tail-calling, how does that integrate with the new `[[clang::musttail]]` attribute?
> Do we correctly reject the program in that case, or are we silently dropping the tail call?

that logic looks, at best, suspicious -- but I've not altered it.
`  if (isTailCall && !IsMustTail) { ... check arch-specific constraints maybe clear isTailCall ... }`
`  if (IsMustTail && !isTailCall) { .. error ..}`
As you can see, when 'musttail' is in play we never check that ISA can actually do it.
I don't know the semantics of musttail though -- is it 'I, the programmer, assert this is ok to tailcall', or 'I, the programmer, expect a correct tail call here'.
If it is the former, the logic is sound, if it is the latter, it is not.  But I think that's an orthogonal issue.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105807/new/

https://reviews.llvm.org/D105807



More information about the llvm-commits mailing list