-
Notifications
You must be signed in to change notification settings - Fork 1.6k
s390x: Remove return-value instructions after calls at callsites #10531
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
Conversation
|
Hi @cfallin , this is the s390x implementation of the new return-value logic. Note that I'm seeing some slight code-gen (performance) regressions, e.g. in Looks like the register allocator does not allocate the vector return value into a register but to a spill slot, even though most registers would be available. Maybe the problem is that on the platform all vector registers are clobbered by calls, and therefore in the clobber list of the pseudo Call instruction. But that shouldn't prevent the allocator from chosing the register as output - not sure if this can be modeled ... |
This is a follow-on to bytecodealliance#10502 implementing the same logic for s390x. Like other platforms, we now no longer emit any instructions handling return values after the call instruction; instead, everything is done within a pseudo Call instruction. Unlike other platforms, this also has to handle vector lane swapping when calling between ABIs that mix BE and LE lane orders. The pseudo Call instruction needs enough type information to make this choice, therefore I had to add a type field to the RetLocation::Reg case (the ::Stack case already had one). All other changes are contained within the s390x back-end. To simplify the implementation, the patch also implements a number of clean-ups: - Introduce a MemArg::SpillOffset variant - Remove the (unnecessary on this platform) island code size check - Merge the CallInd instructions into the base Call instructions, using a new CallInstDest type to carry the call destination
b4fd6a5 to
03b3b09
Compare
|
A register can only be in the clobber list or the output list, not both at the same time. |
Subscribe to Label ActionDetailsThis issue or pull request has been labeled: "cranelift", "cranelift:area:aarch64", "cranelift:area:machinst", "cranelift:area:x64", "isle"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
fitzgen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I will fully admit I am least familiar with s390x out of all of our backends.
Not sure if you also want to take a look at this, @cfallin.
|
Yep, this is on my queue as well; I'll make a pass over it. Thanks Ulrich for getting this together so quickly! |
cfallin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me as well. Thanks!
This is a follow-on to #10502 implementing the same logic for s390x.
Like other platforms, we now no longer emit any instructions handling return values after the call instruction; instead, everything is done within a pseudo Call instruction. Unlike other platforms, this also has to handle vector lane swapping when calling between ABIs that mix BE and LE lane orders. The pseudo Call instruction needs enough type information to make this choice, therefore I had to add a type field to the RetLocation::Reg case (the ::Stack case already had one).
All other changes are contained within the s390x back-end. To simplify the implementation, the patch also implements a number of clean-ups: