From 54143e2bd557e97c5c9032ff87d73eec6fc63c67 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Mon, 22 Jun 2020 16:17:06 -0400 Subject: [PATCH] [VectorCombine] do not use magic number for undef mask element; NFC --- llvm/lib/Transforms/Vectorize/VectorCombine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp index 5c25d04aaf39..eb9ae1e15552 100644 --- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp +++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp @@ -196,7 +196,7 @@ static Value *createShiftShuffle(Value *Vec, unsigned OldIndex, // to the new element index. Example for OldIndex == 2 and NewIndex == 0: // ShufMask = { 2, undef, undef, undef } auto *VecTy = cast(Vec->getType()); - SmallVector ShufMask(VecTy->getNumElements(), -1); + SmallVector ShufMask(VecTy->getNumElements(), UndefMaskElem); ShufMask[NewIndex] = OldIndex; Value *Undef = UndefValue::get(VecTy); return Builder.CreateShuffleVector(Vec, Undef, ShufMask, "shift");