This is an archive of the discontinued LLVM Phabricator instance.

[X86][AVX512] Fixed VPERMT2* shuffle mask decoding and enabled target shuffle combining.
ClosedPublic

Authored by RKSimon on Mar 6 2016, 5:18 AM.

Details

Summary

Patch to add support for target shuffle combining of X86ISD::VPERMV3 nodes, including support for detecting unary shuffles.

This uncovered several issues with the X86ISD::VPERMV shuffle mask decoding of non-64 bit shuffle mask elements - the bit masking wasn't being correctly computed. A similar issue exists with X86ISD::VPERMV nodes that will need to be fixed when this is setup as well, but I will create repro test cases before pushing another patch for review.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 49905.Mar 6 2016, 5:18 AM
RKSimon retitled this revision from to [X86][AVX512] Fixed VPERMT2* shuffle mask decoding and enabled target shuffle combining..
RKSimon updated this object.
RKSimon added reviewers: delena, igorb, ab.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: llvm-commits.
delena added inline comments.Mar 6 2016, 6:12 AM
lib/Target/X86/Utils/X86ShuffleDecode.cpp
485 ↗(On Diff #49905)

Let's assume that VT is v16i32. RawMask.size() = 16
log2(16*2) = log2(32) = 5

M &= 5 ??

I suppose it should be: Mask &= (RawMask.size() * 2 -1)

Yep - you're right, my early tests were firing that code path but it seems nothing else is now - I'll try to add some extra tests for that.

Yep - you're right, my early tests were firing that code path but it seems nothing else is now - I'll try to add some extra tests for that.

An alternative is that we disable the getTargetShuffleMaskIndices path and just get the constant pool path fixed for now - its proving very difficult to get it fire under circumstances that are testable right now.

RKSimon updated this revision to Diff 49920.Mar 6 2016, 9:56 AM

Removed non-constant pool mask decode path as we have no way of testing it right now.

delena accepted this revision.Mar 6 2016, 10:20 AM
delena edited edge metadata.

LGTM

This revision is now accepted and ready to land.Mar 6 2016, 10:20 AM
This revision was automatically updated to reflect the committed changes.