This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix lowering of byval parameters for sizes greater than 8 bytes.
ClosedPublic

Authored by stefanp on Mar 10 2022, 5:28 PM.

Details

Summary

To store a byval parameter the existing code would store as many 8 byte elements
as was required to store the full size of the byval parameter.
For example, a paramter of size 16 would store two element of 8 bytes.
A paramter of size 12 would also store two elements of 8 bytes.
This would sometimes store too many bytes as the size of the paramter is not
always a factor of 8.

This patch fixes that issue and now byval paramters are stored with the correct
number of bytes.

Diff Detail

Event Timeline

stefanp created this revision.Mar 10 2022, 5:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 5:28 PM
stefanp requested review of this revision.Mar 10 2022, 5:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 5:28 PM
stefanp added a reviewer: Restricted Project.Mar 10 2022, 5:30 PM
quinnp accepted this revision as: quinnp.Mar 21 2022, 7:31 AM
quinnp added a subscriber: quinnp.

LGTM

This revision is now accepted and ready to land.Mar 21 2022, 7:31 AM

Seems like we should look at the caller side as well since we might have a similar issue.

stefanp updated this revision to Diff 418117.Mar 24 2022, 8:40 PM

Rebased the patch to top of main branch.

Looked at the caller side as mentioned in the review comment and fixed that as
well.

amyk accepted this revision as: amyk.Mar 26 2022, 8:47 AM
amyk added a subscriber: amyk.

I think this also LGTM.

nemanjai accepted this revision.Mar 31 2022, 10:51 AM

LGTM.

llvm/lib/Target/PowerPC/PPCISelLowering.cpp
4434–4438

Minor nit: maybe indicate that these sizes are in bits in the names - {Store|Load}SizeInBits

stefanp updated this revision to Diff 419551.Mar 31 2022, 1:08 PM

Addressed comment and rebased to top of main.

This revision was landed with ongoing or failed builds.Mar 31 2022, 1:12 PM
This revision was automatically updated to reflect the committed changes.