This is an archive of the discontinued LLVM Phabricator instance.

[ARM,MVE] Add ACLE intrinsics for the vminv/vmaxv family.
ClosedPublic

Authored by simon_tatham on Mar 20 2020, 5:22 AM.

Details

Summary

I've implemented these as target-specific IR intrinsics, because
they're not quite enough like @llvm.experimental.vector.reduce.min
(which doesn't take the extra scalar parameter). Also this keeps the
predicated and unpredicated versions looking similar, and the
floating-point minnm/maxnm versions fold into the same schema.

We had a couple of min/max reductions already implemented, from the
initial pathfinding exercise in D67158. Those were done by having
separate IR intrinsic names for the signed and unsigned integer
versions; as part of this commit, I've changed them to use a flag
parameter indicating signedness, which is how we ended up deciding
that the rest of the MVE intrinsics family ought to work. So now
hopefully the ewhole lot is consistent.

In the new llc test, the output code from the v8f16 test functions
looks quite unpleasant, but most of it is PCS lowering (you can't pass
a half directly in or out of a function). In other circumstances,
where you do something else with your half in the same function, it
doesn't look nearly as nasty.

Diff Detail

Event Timeline

simon_tatham created this revision.Mar 20 2020, 5:22 AM
This revision is now accepted and ready to land.Mar 20 2020, 6:42 AM

Update tests to fix CI failure (oops). Also added opt -sroa to make the incidental half/float argument marshalling a bit less verbose.

This revision was automatically updated to reflect the committed changes.