This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Implement passing SVE vectors by ref for AAPCS.
ClosedPublic

Authored by sdesmalen on Dec 9 2019, 10:04 AM.

Details

Summary

This patch implements the part of the calling convention
where SVE Vectors are passed by reference. This means the
caller must allocate stack space for these objects and
pass the address to the callee.

Diff Detail

Event Timeline

sdesmalen created this revision.Dec 9 2019, 10:04 AM
This revision is now accepted and ready to land.Dec 9 2019, 11:46 AM
sdesmalen updated this revision to Diff 237675.Jan 13 2020, 7:22 AM
  • Added two fixes to DAGCombine where we need to bail out if the type is scalable (the tests ran into some assertion failures otherwise).
efriedma accepted this revision.Jan 13 2020, 1:23 PM

Please add a comment explaining each isScalableVector(), to make it clear why we're excluding them. Otherwise LGTM

llvm/test/CodeGen/AArch64/sve-calling-convention-byref.ll
9

I just thought of this, but should scalable arguments be allowed for calls using the regular C calling convetion? If they are, do we need any additional changes to make that work?

sdesmalen marked an inline comment as done.Jan 14 2020, 9:34 AM

Please add a comment explaining each isScalableVector(), to make it clear why we're excluding them. Otherwise LGTM

Thanks, I'll add some comments for these cases (and do this for future cases I find as well).

llvm/test/CodeGen/AArch64/sve-calling-convention-byref.ll
9

The code that derives aarch64_sve_vector_pcs from the function signature (it takes and/or returns SVE vectors) already exists (in AArch64ISelLowering::LowerCall), so the aarch64_sve_vector_pcs is unnecessary here.

sdesmalen updated this revision to Diff 244957.Feb 17 2020, 6:23 AM
  • Added a few comments to the patch around isScalableVector().
This revision was automatically updated to reflect the committed changes.