-
Notifications
You must be signed in to change notification settings - Fork 13.3k
aarch64-pc-windows: failed to perform tail call elimination on a call site marked musttail #133098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-backend-aarch64 Author: Hans Wennborg (zmodem)
Consider:
(Other aarch64 triples, such as aarch64-unknown-unknown, work.) |
Slightly shorter: (dropped the arguments)
|
This is where we bail out: https://github.com/llvm/llvm-project/blob/b9b9addae6c79c72394c8260106f8ba5281e9747/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp#L8716-L8723 That was added in 5dc8aeb |
(Mostly notes to self.) I think checking that both the caller and callee have the For example, this would not work:
|
) Tail calls were disabled from callers with inreg parameters in 5dc8aeb with a fixme to check if the callee also takes an inreg parameter. The issue is that inreg parameters (which are passed in x0 or x1 for free and member functions respectively) are supposed to be returned (in x0) at the end of the function. In case of a tail call, that means the callee needs to return the same value as the caller would. We can check for that case, and it's not as niche as it sounds, as that's how Clang will lower one function with an sret return value calling another, such as: ``` struct T { int x; }; struct S { T foo(); T bar(); }; T S::foo() { return bar(); } // foo's sret argument will get passed directly to bar ``` Fixes #133098
Consider:
(Other aarch64 triples, such as aarch64-unknown-unknown, work.)
The text was updated successfully, but these errors were encountered: