This is an archive of the discontinued LLVM Phabricator instance.

[X86][SSE41] Combine insertion of zero scalars into vector blends with zero
ClosedPublic

Authored by RKSimon on Feb 20 2016, 8:26 AM.

Details

Summary

This patch attempts to replace the insertion of zero scalars with a vector blend with zero. Not only does this avoid the use of the integer insertion instructions (which are particularly slow on many targets) but it adds the ability to merge multiple insertions together.

There are 2 parts to this patch - the lowering of zero insertions to shuffles and the combining of target shuffles into blends with zeros - if accepted these will be committed separately.

Note: Support for blending in other rematerializable constants (e.g. insertion of all-bits) would be easy to add but multiple insertions wouldn't be merged until we can support combining of binary shuffles. I will add support for the insertion stage now at least if people think its worth it?

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 48595.Feb 20 2016, 8:26 AM
RKSimon retitled this revision from to [X86][SSE41] Combine insertion of zero scalars into vector blends with zero.
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.
qcolombet accepted this revision.Feb 23 2016, 3:49 PM
qcolombet edited edge metadata.

Hi Simon,

LGTM.

Thanks,
-Quentin

lib/Target/X86/X86ISelLowering.cpp
23685 ↗(On Diff #48595)

May be useful to specify the arguments with comments, e.g., /*Pos*/, etc.

This revision is now accepted and ready to land.Feb 23 2016, 3:49 PM
This revision was automatically updated to reflect the committed changes.