This is an archive of the discontinued LLVM Phabricator instance.

[X86][SSE] Basic combining of unary target shuffles of binary target shuffles.
ClosedPublic

Authored by RKSimon on Mar 3 2016, 10:43 AM.

Details

Summary

This patch reorders the combining of target shuffle masks so that when a unary shuffle takes a binary shuffle as its input but only references one of its inputs it can correctly combine into a unary shuffle mask.

There is a lot more work before we can properly support binary target shuffle masks but this was an easy case to add support for.

Note: I have an additional followup patch that will deal with the failed combining of the shuffle_v2i64_bitcast_z123 AVX2 / AVX512 test cases (the blend with zero combining currently fails to combine 2 blend shuffles with the same blend mask).

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 49756.Mar 3 2016, 10:43 AM
RKSimon retitled this revision from to [X86][SSE] Basic combining of unary target shuffles of binary target shuffles..
RKSimon updated this object.
RKSimon added reviewers: qcolombet, ab, spatel, andreadb.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: llvm-commits.
RKSimon updated this revision to Diff 49970.Mar 7 2016, 8:53 AM

Updated patch so that a combined unary mask created from either input - this is starting to encroach on the purpose of resolveTargetShuffleInputs, but I don't want to remove it until we definitely know we won't need it for full binary shuffle combining.

qcolombet accepted this revision.Mar 9 2016, 2:40 PM
qcolombet edited edge metadata.

Hi Simon,

LGTM.

Cheers,
-Quentin

This revision is now accepted and ready to land.Mar 9 2016, 2:40 PM
This revision was automatically updated to reflect the committed changes.

Thanks Quentin - I've submitted the AVX2/AVX512 blend with zero combine improvement as well now.