Page MenuHomePhabricator

[AArch64] Optimize SVE bitcasts of unpacked types.

Authored by efriedma on Jun 18 2021, 3:05 PM.



Target-independent code only knows how to spill to the stack; instead, use AArch64ISD::REINTERPRET_CAST.

Diff Detail

Event Timeline

efriedma created this revision.Jun 18 2021, 3:05 PM
efriedma requested review of this revision.Jun 18 2021, 3:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 18 2021, 3:05 PM
Matt added a subscriber: Matt.Jun 19 2021, 7:55 AM
paulwalker-arm added inline comments.Jun 21 2021, 4:27 AM

You may as well just remove the "Cannot cast between unpacked scalable vector types" assert from getSVESafeBitCast. The original intent of the assert was to catch cases where getSVESafeBitCast wasn't needed because a single REINTERPRET_CAST could do the job. The assert is clearly too generic but at the same time I deliberately didn't add isel patterns for the unpacked-unpacked-fp cases[1], so I don't see a real benefit to tightening up the assert.

[1] I know this is not consistent with i1 handling.


Out of interest are the loads fundamental to these three tests?

efriedma added inline comments.Jun 21 2021, 10:29 AM

Sure, will do.


When I was constructing the tests, I had to be careful to make sure we actually hit the codepath in question. In the simplest cases, the bitcast gets combined away.

Maybe it's not necessary for the final form these tests ended up with, though; I'll check.

efriedma updated this revision to Diff 353424.Jun 21 2021, 10:56 AM

Address review comments.

paulwalker-arm accepted this revision.Jun 22 2021, 3:26 AM
paulwalker-arm added inline comments.

Up to you but perhaps worth pulling this out as it now has three uses.


Can reuse Op here.


Can reuse DL here.

This revision is now accepted and ready to land.Jun 22 2021, 3:26 AM
This revision was landed with ongoing or failed builds.Thu, Jul 1, 3:37 PM
This revision was automatically updated to reflect the committed changes.