This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fix two more places to prefer VPERMQ/PD over VPERM2X128 when AVX2 is enabled
ClosedPublic

Authored by craig.topper on Sep 16 2017, 10:46 AM.

Details

Summary

The shuffle combining and lowerVectorShuffleAsLanePermuteAndBlend were both still trying to use VPERM2XF128 for unary shuffles when AVX2 is enabled. VPERM2X128 takes two inputs meaning when we use it for a unary shuffle one of those inputs is left undefined creating a false dependency on whatever register gets allocated there.

If we have VPERMQ/PD we should prefer those since they only have a single input.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Sep 16 2017, 10:46 AM
RKSimon added inline comments.Sep 17 2017, 3:48 AM
lib/Target/X86/X86ISelLowering.cpp
12150 ↗(On Diff #115542)

What happens if we just replace this with a generic DAG.getVectorShuffle? I'm thinking about when we finally get around to supporting 512-bit in lowerVectorShuffleAsLanePermuteAndBlend.

Use getVectorShuffle

Not sure what happened there. That was clearly the wrong patch

RKSimon accepted this revision.Sep 18 2017, 1:45 AM

LGTM

This revision is now accepted and ready to land.Sep 18 2017, 1:45 AM
This revision was automatically updated to reflect the committed changes.