[PATCH] D27992: [InstCombine] Canonicalize insert sequences that broadcast a value into a insert + shuffle
David Majnemer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 27 14:41:29 PST 2016
majnemer accepted this revision.
majnemer added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: lib/Transforms/InstCombine/InstCombineVectorOps.cpp:641-645
+ SmallVector<Constant *, 16> Mask(
+ NumElements, ConstantInt::get(Type::getInt32Ty(InsElt.getContext()), 0));
+
+ return new ShuffleVectorInst(InsertFirst, UndefValue::get(VT),
+ ConstantVector::get(Mask));
----------------
It might be more efficient to do `ConstantAggregateZero::get(VectorType::get(...)` instead.
https://reviews.llvm.org/D27992
More information about the llvm-commits
mailing list