This is an archive of the discontinued LLVM Phabricator instance.

[X86] Prefer VPERMQ over VPERM2F128 for any unary shuffle, not just the ones that can be done with a insertf128
ClosedPublic

Authored by craig.topper on Sep 15 2017, 12:48 AM.

Details

Summary

The early out for AVX2 in lowerV2X128VectorShuffle is positioned in a weird spot below some shuffle mask equivalency checks.

But I think we want to allow VPERMQ for any unary shuffle.

Diff Detail

Event Timeline

craig.topper created this revision.Sep 15 2017, 12:48 AM
RKSimon added inline comments.Sep 15 2017, 2:50 AM
lib/Target/X86/X86ISelLowering.cpp
12163

Does this even need to be inside the zero test? If V2 is undef, then V1 should not be zero. Can we place it before lowerVectorShuffleAsBlend?

Move AVX2 unary shuffle check to the top of the function.

This revision is now accepted and ready to land.Sep 15 2017, 10:55 AM
This revision was automatically updated to reflect the committed changes.