This is an archive of the discontinued LLVM Phabricator instance.

[X86] Remove dead code from LowerVectorBroadcast
ClosedPublic

Authored by zvi on Nov 15 2016, 8:48 AM.

Details

Summary

Splat vectors are canonicalized to BUILD_VECTOR's so the code can be simplified. NFC-ish.

Diff Detail

Repository
rL LLVM

Event Timeline

zvi updated this revision to Diff 78014.Nov 15 2016, 8:48 AM
zvi retitled this revision from to [X86] Remove dead code from LowerVectorBroadcast.
zvi updated this object.
zvi added reviewers: andreadb, craig.topper, delena.
zvi set the repository for this revision to rL LLVM.
zvi added a subscriber: llvm-commits.
RKSimon accepted this revision.Nov 22 2016, 3:48 AM
RKSimon added a reviewer: RKSimon.
RKSimon added a subscriber: RKSimon.

LGTM

This revision is now accepted and ready to land.Nov 22 2016, 3:48 AM
andreadb added inline comments.Nov 22 2016, 4:23 AM
lib/Target/X86/X86ISelLowering.cpp
6030

Would it be possible to change this function so that 'Op' is a BuildVectorSDNode rather than a generic SDValue?
The expicit cast at line 5859 would become redundant then.

It looks like this function is only used by method 'LowerBUILD_VECTOR' at around line 6646.

zvi added inline comments.Nov 22 2016, 6:44 AM
lib/Target/X86/X86ISelLowering.cpp
6030

Sure.

andreadb accepted this revision.Nov 22 2016, 6:44 AM
andreadb edited edge metadata.
zvi updated this revision to Diff 78869.EditedNov 22 2016, 7:06 AM
zvi edited edge metadata.

Applied @andreadb's suggestion, and we could do the same to lowerBuildVectorToBitOp in a follow-up commit.
I also eliminated the 'Splat' variable, so the diff may look a bit larger.

LGTM. Thanks Zvi!

This revision was automatically updated to reflect the committed changes.