-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[AArch64][GISel] Incorrect ABI for calls with tail marker #70207
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
[AArch64][GISel] Incorrect ABI for calls with tail marker #70207
Comments
@llvm/issue-subscribers-backend-aarch64 Author: Nikita Popov (nikic)
```llvm
; RUN: llc -O0 -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
declare void @func(i64, i64, i64, i64, i64, i128, i128)
define void @test(i128 %arg1, i128 %arg2) nounwind {
Note that both of the i128 arguments get passed on the stack. Compare with the sub sp, sp, #<!-- -->32
str x30, [sp, #<!-- -->16] // 8-byte Folded Spill
mov x7, x1
mov x6, x0
mov x8, sp
str x3, [x8, #<!-- -->8]
str x2, [x8]
mov x4, xzr
mov x0, x4
mov x1, x4
mov x2, x4
mov x3, x4
bl func
ldr x30, [sp, #<!-- -->16] // 8-byte Folded Reload
add sp, sp, #<!-- -->32
ret In this case the first i128 argument is passed in registers and only the second one on the stack. Peculiarly, this does not happen when dropping the |
The problem seems to be that
|
/branch llvm/llvm-project-release-prs/issue70207 |
…(#70215) The check for whether a tail call is supported calls determineAssignments(), which may modify argument flags. As such, even though the check fails and a non-tail call will be emitted, it will not have a different (incorrect) ABI. Fix this by operating on a separate copy of the arguments. Fixes llvm/llvm-project#70207. (cherry picked from commit 292f34b0d3cb2a04be5ebb85aaeb838b29f71323)
/pull-request llvm/llvm-project-release-prs#760 |
…(#70215) The check for whether a tail call is supported calls determineAssignments(), which may modify argument flags. As such, even though the check fails and a non-tail call will be emitted, it will not have a different (incorrect) ABI. Fix this by operating on a separate copy of the arguments. Fixes llvm/llvm-project#70207. (cherry picked from commit 292f34b0d3cb2a04be5ebb85aaeb838b29f71323)
This produces:
Note that both of the i128 arguments get passed on the stack. Compare with the
-global-isel=0
output:In this case the first i128 argument is passed in registers and only the second one on the stack.
Peculiarly, this does not happen when dropping the
tail
marker (which shouldn't make a difference as no actual tail call gets generated).The text was updated successfully, but these errors were encountered: