This is an archive of the discontinued LLVM Phabricator instance.

[SLPVectorizer] Relax "alternate" opcode vectorisation to work with any SK_Select shuffle pattern
ClosedPublic

Authored by RKSimon on Jun 14 2018, 9:01 AM.

Details

Summary

D47985 saw the old SK_Alternate 'alternating' shuffle mask replaced with the SK_Select mask which accepts either input operand for each lane, equivalent to a vector select with a constant condition operand.

This patch updates SLPVectorizer to make full use of this SK_Select shuffle pattern by removing the 'isOdd()' limitation.

The AArch64 regression will be avoided by the patches D48023 and D48172 which I hope to commit first, this patch then manages to fully vectorise the code.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Jun 14 2018, 9:01 AM
RKSimon updated this revision to Diff 152048.Jun 20 2018, 3:15 AM

Rebased - the aarch64 regression is purely due to the incorrect shuffle costs in AArch64TargetTransformInfo.cpp which D48172 is handling.

I'd like to get this patch in to simplify my next work in the SLP, instead of waiting for D48172 - what do people think?

This revision is now accepted and ready to land.Jun 20 2018, 6:44 AM
This revision was automatically updated to reflect the committed changes.