diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-10-10 20:39:39 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-10-10 20:39:39 +0000 |
commit | 58fc00d0bc1d33afbecfd7d83fb60529b7decb40 (patch) | |
tree | 92a2fbc71110c479f94444f2951e915f238a5c00 /llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | |
parent | 9ae88c64fa6ee582578c4a018cf92ada6a8bb08d (diff) | |
download | bcm5719-llvm-58fc00d0bc1d33afbecfd7d83fb60529b7decb40.tar.gz bcm5719-llvm-58fc00d0bc1d33afbecfd7d83fb60529b7decb40.zip |
revert r344082: [InstCombine] reverse 'trunc X to <N x i1>' canonicalization
This commit accidentally included the diffs from D53057.
llvm-svn: 344178
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index 7258127f319..61a3e31f960 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -1477,33 +1477,6 @@ static Instruction *narrowVectorSelect(ShuffleVectorInst &Shuf, return SelectInst::Create(NarrowCond, NarrowX, NarrowY); } -/// Try to combine 2 shuffles into 1 shuffle by concatenating a shuffle mask. -static Instruction *foldIdentityExtractShuffle(ShuffleVectorInst &Shuf) { - Value *Op0 = Shuf.getOperand(0), *Op1 = Shuf.getOperand(1); - if (!Shuf.isIdentityWithExtract() || !isa<UndefValue>(Op1)) - return nullptr; - - Value *X, *Y; - Constant *Mask; - if (!match(Op0, m_ShuffleVector(m_Value(X), m_Value(Y), m_Constant(Mask)))) - return nullptr; - - // We are extracting a subvector from a shuffle. Remove excess elements from - // the 1st shuffle mask to eliminate the extract. - // shuf (shuf X, Y, <C0, C1, C2, C3>), undef, <0, undef, 2> --> - // shuf X, Y, <C0, undef, C2> - unsigned NumElts = Shuf.getType()->getVectorNumElements(); - SmallVector<Constant *, 16> NewMask(NumElts); - for (unsigned i = 0; i != NumElts; ++i) { - // If the extracting shuffle has an undef mask element, it transfers to the - // new shuffle mask. Otherwise, copy the original mask element. - Constant *ExtractMaskElt = Shuf.getMask()->getAggregateElement(i); - Constant *MaskElt = Mask->getAggregateElement(i); - NewMask[i] = isa<UndefValue>(ExtractMaskElt) ? ExtractMaskElt : MaskElt; - } - return new ShuffleVectorInst(X, Y, ConstantVector::get(NewMask)); -} - Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) { Value *LHS = SVI.getOperand(0); Value *RHS = SVI.getOperand(1); @@ -1526,9 +1499,6 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) { return &SVI; } - if (Instruction *I = foldIdentityExtractShuffle(SVI)) - return I; - SmallVector<int, 16> Mask = SVI.getShuffleMask(); Type *Int32Ty = Type::getInt32Ty(SVI.getContext()); unsigned LHSWidth = LHS->getType()->getVectorNumElements(); |