diff options
author | Dan Gohman <gohman@apple.com> | 2008-08-06 18:17:32 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-08-06 18:17:32 +0000 |
commit | 4ce9627e97094163f8a55cf0cb74f074bd17dfc8 (patch) | |
tree | dba7ca1b2c0fb653e13faeba0f6fda7474831ced /lib/Transforms | |
parent | d756f8820ab054882b7517e232e9e448893b60a7 (diff) | |
download | external_llvm-4ce9627e97094163f8a55cf0cb74f074bd17dfc8.zip external_llvm-4ce9627e97094163f8a55cf0cb74f074bd17dfc8.tar.gz external_llvm-4ce9627e97094163f8a55cf0cb74f074bd17dfc8.tar.bz2 |
Fix a shufflevector instcombine that was emitting invalid masks indices
when it meant to be emitting undef indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54417 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 3a74c7f..eebb7cf 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -11259,11 +11259,13 @@ Instruction *InstCombiner::visitShuffleVectorInst(ShuffleVectorInst &SVI) { Elts.push_back(UndefValue::get(Type::Int32Ty)); else { if ((Mask[i] >= e && isa<UndefValue>(RHS)) || - (Mask[i] < e && isa<UndefValue>(LHS))) + (Mask[i] < e && isa<UndefValue>(LHS))) { Mask[i] = 2*e; // Turn into undef. - else + Elts.push_back(UndefValue::get(Type::Int32Ty)); + } else { Mask[i] &= (e-1); // Force to LHS. - Elts.push_back(ConstantInt::get(Type::Int32Ty, Mask[i])); + Elts.push_back(ConstantInt::get(Type::Int32Ty, Mask[i])); + } } } SVI.setOperand(0, SVI.getOperand(1)); |