This is an archive of the discontinued LLVM Phabricator instance.

[ARM][MVE] Factor out an IntrinsicMX multiclass.
ClosedPublic

Authored by simon_tatham on Dec 11 2019, 2:50 AM.

Details

Summary

The ACLE intrinsics for MVE contain a lot of pairs of functions with
_m and _x in the name, wrapping a predicated MVE instruction which
only partially overwrites its output register. They have the common
pattern that the _m variant takes an initial argument called
'inactive', of the same type as the return value, supplying the input
value of the output register, so that lanes disabled by the
predication will be taken from that parameter; the _x variant omits
that initial argument, and simply sets it to undef.

That common pattern is simple enough to wrap into a multiclass, which
should save a lot of effort in setting up all the rest of the _x
variants. In this commit I introduce multiclass IntrinsicMX in
arm_mve_defs.td, and convert existing generation of m/x pairs to use
it.

This allows me to remove the PredicatedImmediateVectorShift
multiclass (from D71065) completely, because the new multiclass makes
it so much simpler that it's not worth bothering to define it at all.

Diff Detail

Event Timeline

simon_tatham created this revision.Dec 11 2019, 2:50 AM

Refactored further to remove the PredicatedImmediateVectorShift
multiclass completely: the amount of useful content remaining in it
now doesn't seem to justify its existence.

simon_tatham edited the summary of this revision. (Show Details)Dec 11 2019, 2:57 AM
miyuki accepted this revision.Dec 11 2019, 3:09 AM

LGTM

This revision is now accepted and ready to land.Dec 11 2019, 3:09 AM
This revision was automatically updated to reflect the committed changes.