A tuple of primitives function parameter is passed via the stack even though the tuple constituents could be passed as registers #64099
Labels
I-slow
Issue: Problems and improvements with respect to performance of generated code.
O-linux
Operating system: Linux
O-x86_64
Target: x86-64 processors (like x86_64-*)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
1.36.0 x86_64-unknown-linux-gnu
passes the tuple via the stack
However if the function has four
usize
parameters, they're passed via registers.It would be nice if the tuple case also used registers.
Perhaps related to / same as #63244 . The tuple-taking
foo
has an aggregate parameter, and making multi-constituent tuples transparent (as suggested there) would help?Tuple-taking
foo
:vs four-parameter
foo
:I discovered this with a
fn (Option<(NonNull<FatPointer>, NonNull<FatPointer>)>) -> (Option<NonNull<FatPointer>>, Option<NonNull<FatPointer>>)
. So I can't just rewrite this to use four separate parameters.The two
usize
cases and theOption
case are in this godbolt for reference.The text was updated successfully, but these errors were encountered: