diff options
author | Sanjay Patel <spatel@rotateright.com> | 2019-11-25 10:54:18 -0500 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2019-11-25 10:54:18 -0500 |
commit | 847aabf11f988a774ae8078a2e567dad8c709bbe (patch) | |
tree | 44ed2a648ea63b966000485ab92ab076bf04fed2 /llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | |
parent | 20684092ab600d166f0346485945d5d618b08420 (diff) | |
download | bcm5719-llvm-847aabf11f988a774ae8078a2e567dad8c709bbe.tar.gz bcm5719-llvm-847aabf11f988a774ae8078a2e567dad8c709bbe.zip |
[InstCombine] remove dead code from shuffle mask canonicalization; NFC
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index eae8bd7452d..2f9d342daca 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -1891,6 +1891,7 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) { SmallVector<int, 16> Mask = SVI.getShuffleMask(); Type *Int32Ty = Type::getInt32Ty(SVI.getContext()); if (LHS == RHS || isa<UndefValue>(LHS)) { + assert(!isa<UndefValue>(RHS) && "Shuffle with 2 undef ops not simplified?"); // Remap any references to RHS to use LHS. SmallVector<Constant*, 16> Elts; for (unsigned i = 0; i != VWidth; ++i) { @@ -1899,8 +1900,7 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) { continue; } - if ((Mask[i] >= (int)LHSWidth && isa<UndefValue>(RHS)) || - (Mask[i] < (int)LHSWidth && isa<UndefValue>(LHS))) { + if (Mask[i] < (int)LHSWidth && isa<UndefValue>(LHS)) { Mask[i] = -1; // Turn into undef. Elts.push_back(UndefValue::get(Int32Ty)); } else { |