This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] No NEON instructions to support vector of i64 reductions
ClosedPublic

Authored by cameron.mcinally on Sep 23 2020, 9:30 AM.

Details

Summary

There are no NEON instructions to support vector of i64 reductions.

It could be possible to support v2i64 ISD::VECREDUC_ADD with AArch64ISD::UADDLV, but that's probably better left for a separate patch.

Does this change need an XFAIL test? They're not currently tested, so wasn't sure on the protocol for that.

Diff Detail

Event Timeline

cameron.mcinally requested review of this revision.Sep 23 2020, 9:30 AM

It appears lowering for v2i64 VECREDUCE_ADD currently works correctly; it produces an addp. It appears v2i64 VECREDUCE_SMAX is currently broken. Does this patch change either of those?

You're right about v2i64 UADDV. The existing test didn't catch my regression, so I added a new CHECK line to that test. Also added a line to Custom lower that as before.

v2i64 *MAXV currently gives a Cannot select. That makes sense since *MAXP also doesn't support i64.

v2i64 *MAXV currently gives a Cannot select. That makes sense since *MAXP also doesn't support i64.

What happens if someone tries to use llvm.experimental.vector.reduce.smax.v2i64 with this patch? I guess this change stops us from generating MAXV, but what happens instead? Can we write a test for that?

How about something like this? Not really exhaustive coverage, but it matches the current legalization tests for the reduce intrinsics.

This revision is now accepted and ready to land.Sep 23 2020, 1:10 PM