summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-06 18:17:32 +0000
committerDan Gohman <gohman@apple.com>2008-08-06 18:17:32 +0000
commitac22cfcae954c9b1f1893ef62487fe50c221aa1b (patch)
tree54f747cdc43a01c8e9318f5d7e9b9c9dc38f1218 /llvm/lib/Transforms/Scalar
parent2bd97afb997fdc8bc32f0ba7d9e723880b43be5e (diff)
downloadbcm5719-llvm-ac22cfcae954c9b1f1893ef62487fe50c221aa1b.tar.gz
bcm5719-llvm-ac22cfcae954c9b1f1893ef62487fe50c221aa1b.zip
Fix a shufflevector instcombine that was emitting invalid masks indices
when it meant to be emitting undef indices. llvm-svn: 54417
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 3a74c7f73d0..eebb7cf82f5 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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));
OpenPOWER on IntegriCloud