This is an archive of the discontinued LLVM Phabricator instance.

[AVX-512] Add support for changing VSHUFF64x2 to VSHUFF32x4 when its feeding a vselect with 32-bit element size.
ClosedPublic

Authored by craig.topper on Nov 23 2016, 11:13 PM.

Details

Summary

Shuffle lowering may have widened the element size of a i32 shuffle to i64 before selecting X86ISD::SHUF128. If this shuffle was used by a vselect this can prevent us from selecting masked operations.

This patch detects this and changes the element size to match the vselect.

I don't handle changing integer to floating point or vice versa as its not clear if its better to push such a bitcast to the inputs of the shuffle or to the user of the vselect. So I'm ignoring that case for now.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper retitled this revision from to [AVX-512] Add support for changing VSHUFF64x2 to VSHUFF32x4 when its feeding a vselect with 32-bit element size..
craig.topper updated this object.
craig.topper added reviewers: RKSimon, delena, zvi.
craig.topper added a subscriber: llvm-commits.
zvi edited edge metadata.Nov 24 2016, 3:09 AM

LGTM

Zvi, did you forget to accept the revision or did you want someone else to look at it?

RKSimon accepted this revision.Nov 25 2016, 5:21 AM
RKSimon edited edge metadata.

LGTM

lib/Target/X86/X86ISelLowering.cpp
27779 ↗(On Diff #79187)

Add a TODO to investigate this in the future?

This revision is now accepted and ready to land.Nov 25 2016, 5:21 AM
This revision was automatically updated to reflect the committed changes.