This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Canonicalize insert sequences that broadcast a value into a insert + shuffle
ClosedPublic

Authored by mkuper on Dec 20 2016, 10:34 AM.

Details

Summary

A combine that canonicalizes a chain of inserts that broadcasts a value into a single insert + a splat shufflevector.

This fixes PR31286, since we actually do the right thing when the broadcast is canonical.
(See "good4"test)

Diff Detail

Event Timeline

mkuper updated this revision to Diff 82119.Dec 20 2016, 10:34 AM
mkuper retitled this revision from to [InstCombine] Canonicalize insert sequences that broadcast a value into a insert + shuffle.
mkuper updated this object.
mkuper added reviewers: majnemer, spatel.
mkuper added a subscriber: llvm-commits.

A gentle holiday ping.

majnemer accepted this revision.Dec 27 2016, 2:41 PM
majnemer edited edge metadata.

LGTM

lib/Transforms/InstCombine/InstCombineVectorOps.cpp
641–645

It might be more efficient to do ConstantAggregateZero::get(VectorType::get(...) instead.

This revision is now accepted and ready to land.Dec 27 2016, 2:41 PM
This revision was automatically updated to reflect the committed changes.