aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/ConstantFold.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r--lib/VMCore/ConstantFold.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index 9c2919ea1d..f1b97dfce1 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -787,6 +787,9 @@ Constant *llvm::ConstantFoldShuffleVectorInstruction(Constant *V1,
// Undefined shuffle mask -> undefined value.
if (isa<UndefValue>(Mask)) return UndefValue::get(V1->getType());
+ // Don't break the bitcode reader hack.
+ if (isa<ConstantExpr>(Mask)) return 0;
+
unsigned MaskNumElts = Mask->getType()->getVectorNumElements();
unsigned SrcNumElts = V1->getType()->getVectorNumElements();
Type *EltTy = V1->getType()->getVectorElementType();