This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][AIX] Support passing vector arguments on the stack.
ClosedPublic

Authored by sfertile on Feb 10 2021, 6:49 AM.

Details

Summary

Once all vector registers have been consumed by arguments, spill the remaining vector arguments to the stack.

Diff Detail

Event Timeline

sfertile created this revision.Feb 10 2021, 6:49 AM
sfertile requested review of this revision.Feb 10 2021, 6:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 10 2021, 6:49 AM
sfertile retitled this revision from [PowerPC][AIX} Support passing vector arguments on the stack. to [PowerPC][AIX] Support passing vector arguments on the stack..Feb 10 2021, 6:49 AM
sfertile updated this revision to Diff 322673.Feb 10 2021, 6:53 AM

Use early return instead.

ZarkoCA added inline comments.Feb 10 2021, 7:05 AM
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
6402–6403

Do we need the VecSize variable here instead of just using 16?

llvm/test/CodeGen/PowerPC/aix-vec-arg-spills-mir.ll
1

Does the script work with AIX now? It would make things a lot easier.

15

Format to the beginning of the line.

78

Maybe an empty line separating the 32bit and 64bit would be better.

llvm/test/CodeGen/PowerPC/aix-vec-arg-spills.ll
82

; can be removed, I think.

llvm/test/CodeGen/PowerPC/aix-vector-stack.ll
1

I think we can remove this test? The ones you added do a much better job of showing what the ABI does.

sfertile updated this revision to Diff 322801.Feb 10 2021, 12:54 PM
sfertile marked 3 inline comments as done.

Addressed review comments.

llvm/lib/Target/PowerPC/PPCISelLowering.cpp
6402–6403

While it would still be obvious what the 16 represented if used directly in the allocate stack call I think its still better to name it.

llvm/test/CodeGen/PowerPC/aix-vec-arg-spills-mir.ll
1

It did for this test. if you hit any cases where it fails to work let me know and we can fix it.

llvm/test/CodeGen/PowerPC/aix-vector-stack.ll
1

I think its worthwhile to keep this test around too. The other ones are complex and take a long time to read and understand where everything gets mapped and why. This one shows exactly how we spill the vectors in a simple as possible way. If something breaks looking at the output of this test is much easier than having to wade through the other more thorough tests.

ZarkoCA accepted this revision.Feb 11 2021, 2:15 PM

Thanks. LGTM.

This revision is now accepted and ready to land.Feb 11 2021, 2:15 PM
This revision was landed with ongoing or failed builds.Feb 18 2021, 10:34 AM
This revision was automatically updated to reflect the committed changes.