[llvm] r303416 - Fix vector pass-through value being unused in IRBuilder::CreateMaskedGather
Amara Emerson via llvm-commits
llvm-commits at lists.llvm.org
Fri May 19 03:40:18 PDT 2017
Author: aemerson
Date: Fri May 19 05:40:18 2017
New Revision: 303416
URL: http://llvm.org/viewvc/llvm-project?rev=303416&view=rev
Log:
Fix vector pass-through value being unused in IRBuilder::CreateMaskedGather
Also s/0/nullptr in the call site in LV.
Modified:
llvm/trunk/lib/IR/IRBuilder.cpp
llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
Modified: llvm/trunk/lib/IR/IRBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/IRBuilder.cpp?rev=303416&r1=303415&r2=303416&view=diff
==============================================================================
--- llvm/trunk/lib/IR/IRBuilder.cpp (original)
+++ llvm/trunk/lib/IR/IRBuilder.cpp Fri May 19 05:40:18 2017
@@ -381,8 +381,11 @@ CallInst *IRBuilderBase::CreateMaskedGat
Mask = Constant::getAllOnesValue(VectorType::get(Type::getInt1Ty(Context),
NumElts));
+ if (!PassThru)
+ PassThru = UndefValue::get(DataTy);
+
Type *OverloadedTypes[] = {DataTy, PtrsTy};
- Value * Ops[] = {Ptrs, getInt32(Align), Mask, UndefValue::get(DataTy)};
+ Value * Ops[] = {Ptrs, getInt32(Align), Mask, PassThru};
// We specify only one type when we create this intrinsic. Types of other
// arguments are derived from this type.
Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=303416&r1=303415&r2=303416&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Fri May 19 05:40:18 2017
@@ -3047,7 +3047,7 @@ void InnerLoopVectorizer::vectorizeMemor
if (CreateGatherScatter) {
Value *MaskPart = Legal->isMaskRequired(LI) ? Mask[Part] : nullptr;
NewLI = Builder.CreateMaskedGather(VectorGep[Part], Alignment, MaskPart,
- 0, "wide.masked.gather");
+ nullptr, "wide.masked.gather");
Entry[Part] = NewLI;
} else {
// Calculate the pointer for the specific unroll-part.
More information about the llvm-commits
mailing list