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
Diff Detail
Unit Tests
Unit Tests
Time | Test | |
---|---|---|
1,460 ms | x64 windows > lit.lit::reorder.py |
Event Timeline
Comment Actions
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.
Comment Actions
Fixed the issue in SelectionDAG too. Not quite identical there, but still fundamentally hinged on exactly where the check should be placed.
Comment Actions
LGTM with comment nit.
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | ||
---|---|---|
1713 ↗ | (On Diff #331239) | An example of what code you're looking for in this comment would be helpful. |
clang-tidy: warning: isa_and_nonnull<> is preferred over an explicit test for null followed by calling isa<> [llvm-prefer-isa-or-dyn-cast-in-conditionals]
not useful