musttail calls have to directly precede the return instruction (of their value), so any stack checks must be inserted before the call instead of in between it and the return. Fortunately this same restriction means we don't have to look too hard to find out if we're about to break a musttail call.
Diff Detail
Event Timeline
We've just discovered there are problems on the SDAG path too for guaranteed tail calls. I'll update the patch once I've got a fix ready.
Fixed the issue in SelectionDAG too. Not quite identical there, but still fundamentally hinged on exactly where the check should be placed.
LGTM with comment nit.
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | ||
---|---|---|
1713 | An example of what code you're looking for in this comment would be helpful. |
clang-tidy: warning: invalid case style for function 'FindSplitPointForStackProtector' [readability-identifier-naming]
not useful