This is an archive of the discontinued LLVM Phabricator instance.

[ARM,MVE] Add an InstCombine rule permitting VPNOT.
ClosedPublic

Authored by simon_tatham on Nov 20 2019, 2:58 AM.

Details

Summary

If a user writing C code using the ACLE MVE intrinsics generates a
predicate and then complements it, then the resulting IR will use the
pred_v2i IR intrinsic to turn some <n x i1> vector into a 16-bit
integer; complement that integer; and convert back. This will generate
machine code that moves the predicate out of the P0 register,
complements it in an integer GPR, and moves it back in again.

This InstCombine rule replaces i2v(~v2i(x)) with a direct complement
of the original predicate vector, which we can already instruction-
select as the VPNOT instruction which complements P0 in place.

Diff Detail

Event Timeline

simon_tatham created this revision.Nov 20 2019, 2:58 AM
dmgreen accepted this revision.Nov 21 2019, 8:00 AM

Looks like a good one. LGTM.

This revision is now accepted and ready to land.Nov 21 2019, 8:00 AM
This revision was automatically updated to reflect the committed changes.