teapotd opened PR #1670 from win64-pass-by-ref
to master
:
This PR goes on top of #1510 and fixes legalization of function arguments in win64 ABI - arguments larger than pointer width are passed by reference. Fixes #1651.
bjorn3 created PR Review Comment:
I think this should instead be a new variant of
ArgumentLoc
.
bjorn3 submitted PR Review.
teapotd submitted PR Review.
teapotd created PR Review Comment:
I implemented the change of value into pointer as a new
ValueConversion
, like splitting or zero-extending, so it's separate from argument location. In case of passing-by-ref,location
specifies how pointer (not the original value) should be passed - register or stack. For example legalization ofi128
argument for win64 goes as follows:
- We start with
i128
- First pass:
i128
is converted to pointer of typei64
- Second pass: Now argument has type
i64
, so we assign register or stack locationAs far as I can see the signature legalization just changes argument types without saving information how to convert them and it is later recovered during legalization of calls/entry block params (legalize_abi_value). I introduced
legalized_to_pointer
flag to be able to detect it has been converted to pointer (and not split, for example).
bjorn3 submitted PR Review.
bjorn3 created PR Review Comment:
For
(i64, i64, i64, i64, i128)
is thei128
still passed as a pointer, and then the pointer is stored on the stack like a normal argument that doesn't fit in a register anymore?
bjorn3 edited PR Review Comment.
teapotd submitted PR Review.
teapotd created PR Review Comment:
teapotd updated PR #1670 from win64-pass-by-ref
to master
:
This PR goes on top of #1510 and fixes legalization of function arguments in win64 ABI - arguments larger than pointer width are passed by reference. Fixes #1651.
teapotd updated PR #1670 from win64-pass-by-ref
to master
:
This PR goes on top of #1510 and fixes legalization of function arguments in win64 ABI - arguments larger than pointer width are passed by reference. Fixes #1651.
teapotd updated PR #1670 from win64-pass-by-ref
to master
:
This PR goes on top of #1510 and fixes legalization of function arguments in win64 ABI - arguments larger than pointer width are passed by reference. Fixes #1651.
fitzgen created PR Review Comment:
Nitpick: just to make this a little more clear for readers
assigning_returns: bool,
fitzgen submitted PR Review.
fitzgen submitted PR Review.
fitzgen created PR Review Comment:
Does this test need all of these things? I would expect
test legalizer target x86_64
in the
filetests/legalizer
directory.It isn't clear to me that we need to go all the way through compilation to exercise the things this test is nominally checking, nor would we need
is_pic
andopt_level=speed_and_size
. Am I missing something?
teapotd submitted PR Review.
teapotd created PR Review Comment:
You're right, I'll change it
teapotd updated PR #1670 from win64-pass-by-ref
to master
:
This PR goes on top of #1510 and fixes legalization of function arguments in win64 ABI - arguments larger than pointer width are passed by reference. Fixes #1651.
teapotd requested fitzgen for a review on PR #1670.
fitzgen submitted PR Review.
fitzgen merged PR #1670.
Last updated: Nov 22 2024 at 16:03 UTC