This is an archive of the discontinued LLVM Phabricator instance.

[Power9] Improvements to vector extract with variable index exploitation
ClosedPublic

Authored by syzaara on Sep 26 2017, 11:53 AM.

Details

Summary

The patch https://reviews.llvm.org/D34032 added exploitation for vector extract with variable index instructions. Under the case of extracting word element 1, using the MFVSRWZ is a better option since it does not requite an extra gpr input and requires no extra shuffles. Also added patterns for extracting to i32 rather than i64.

Diff Detail

Repository
rL LLVM

Event Timeline

syzaara created this revision.Sep 26 2017, 11:53 AM
nemanjai accepted this revision.Nov 27 2017, 6:56 AM

Other than the inline comment, LGTM

lib/Target/PowerPC/PPCInstrVSX.td
1909 ↗(On Diff #116691)

I just realized that we test different things for Power9 and pre-Power9. This should probably be fixed on the commit.
What I mean is that we test for HasP9Altivec for deciding to use the VEXTU... instructions and test for NoP9Vector for deciding not to use them. Please unify these. If there are other uses of NoP9Vector that should continue to use that predicate, then just add another one NoP9Altivec. Otherwise, just change the existing one to that.

This revision is now accepted and ready to land.Nov 27 2017, 6:56 AM
This revision was automatically updated to reflect the committed changes.