elliottt opened PR #5172 from trevor/ret-ssa
to main
:
Modify return pseudoinstructions to have pairs of registers: virtual and real. This allows us to constrain the virtual registers to the real ones specified by the abi, instead of directly emitting moves to those real regisers.
Additionally, this PR marks
r14
on s390x as non-allocatable, as it's used as the link register in the return instruction.
<!--Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
cfallin submitted PR review.
cfallin created PR review comment:
This is going to make things a little interesting too: properly speaking, an extend should allocate a new temp for fully SSA output, rather than coerce the preg to a Writable and extend into it.
cfallin submitted PR review.
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
elliottt has marked PR #5172 as ready for review.
elliottt submitted PR review.
elliottt created PR review comment:
Neat, we avoided a move :tada:
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
uweigand submitted PR review.
uweigand submitted PR review.
uweigand created PR review comment:
Hi @elliottt this seems a bug: the
lgr
overwrites the effect of thellgfr
. Is there some problem with the extension handling on return values?
uweigand created PR review comment:
Hi @elliottt this seems a bug: the
lgr
overwrites the effect of thellgfr
. Is there some problem with the extension handling on return values?
uweigand submitted PR review.
uweigand submitted PR review.
uweigand created PR review comment:
Doesn't this now violate the x64 ABI? I thought this requires the struct-ret pointer to be returned in %rax, that was the whole point of the logic of adding a
StructReturn
element to the return values?
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
elliottt submitted PR review.
elliottt created PR review comment:
There are currently some problems with struct-return that I'm tracking down. I think all the comments you added are directly related.
elliottt created PR review comment:
@uweigand: I think that Chris's comment here is the same problem you noticed with extension on returns.
elliottt submitted PR review.
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
elliottt submitted PR review.
elliottt created PR review comment:
@uweigand could you take another look? After the change to introduce a temporary for the extension, these tests also lack the initial
lgr
instruction, turning into justllgfr %r2, %r2
.
uweigand created PR review comment:
That's even better, removes an unnecessary copy and just zero-extends
%r2
in place. The s390x test changes look all good to me now. (Mostly just renamed registers; in several cases we get better code by eliminating register copies or spills, and a few cases -notably relating to divide instructions- we get slightly worse code. Overall still good though.)
uweigand submitted PR review.
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
elliottt edited PR #5172 from trevor/ret-ssa
to main
:
Modify return pseudoinstructions to have pairs of registers: virtual and real. This allows us to constrain the virtual registers to the real ones specified by the abi, instead of directly emitting moves to those real regisers.
<!--Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
elliottt created PR review comment:
This should be fixed now.
elliottt submitted PR review.
elliottt requested cfallin for a review on PR #5172.
elliottt updated PR #5172 from trevor/ret-ssa
to main
.
cfallin submitted PR review.
elliottt merged PR #5172.
Last updated: Dec 23 2024 at 12:05 UTC