https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96836
Bug ID: 96836 Summary: [MVE] Consider using define_subst for predicatable operations Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: rsandifo at gcc dot gnu.org CC: ktkachov at gcc dot gnu.org, ramana at gcc dot gnu.org, rearnsha at gcc dot gnu.org Target Milestone: --- Target: arm*-*-* Created attachment 49147 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49147&action=edit Proof of concept patch. [This is really just an idea rather than a PR.] At the moment we use separate patterns for the predicated and unpredicated forms of MVE instructions. The predicated ones have a VPST instruction built in. This works well, but we might want to consider using define_subst to define both the predicated and unpredicated forms at the same time. As well as shortening the definition, it could help when making future optimisations, such as: - putting more than one instruction in the same VPST block - using VPT instead of a combination of a comparison and a VPST - using loop predication I've attached a proof of concept that does this for one arbitrarily- chosen intrinsic (vorrq_n). It's not worth submitting on its own, it would only be useful as part of a wider move to this style. (Equally, I don't think it would be necessary to convert everything at once. We'd just need some indication that the approach is going somewhere and won't stop at this one intrinsic.)