diff options
author | wangmp <wangmp@91177308-0d34-0410-b5e6-96231b3b80d8> | 2009-01-26 04:39:00 +0000 |
---|---|---|
committer | wangmp <wangmp@91177308-0d34-0410-b5e6-96231b3b80d8> | 2009-01-26 04:39:00 +0000 |
commit | 496a76d5015bb9c34bf31ff783869ebd9f85d57c (patch) | |
tree | 63e6d9cd531bc06aee57f5e3c468529c55b63a8f /lib | |
parent | c2517d3c633e362d4fc340b29902b90544302646 (diff) | |
download | external_llvm-496a76d5015bb9c34bf31ff783869ebd9f85d57c.zip external_llvm-496a76d5015bb9c34bf31ff783869ebd9f85d57c.tar.gz external_llvm-496a76d5015bb9c34bf31ff783869ebd9f85d57c.tar.bz2 |
Fixed optimization of combining two shuffles where the first shuffle inputs
has a different number of elements than the output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62998 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 40289ea..7f75928 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -12179,9 +12179,11 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) { // If the result mask is equal to the src shuffle or this shuffle mask, do // the replacement. if (NewMask == LHSMask || NewMask == Mask) { + unsigned LHSInNElts = + cast<VectorType>(LHSSVI->getOperand(0)->getType())->getNumElements(); std::vector<Constant*> Elts; for (unsigned i = 0, e = NewMask.size(); i != e; ++i) { - if (NewMask[i] >= e*2) { + if (NewMask[i] >= LHSInNElts*2) { Elts.push_back(UndefValue::get(Type::Int32Ty)); } else { Elts.push_back(ConstantInt::get(Type::Int32Ty, NewMask[i])); |