unbreak test/Bitcode/shuffle.ll.
authorChris Lattner <sabre@nondot.org>
Thu, 26 Jan 2012 03:10:45 +0000 (03:10 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 26 Jan 2012 03:10:45 +0000 (03:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149033 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/ConstantFold.cpp

index 9c2919ea1d8e7764c3e9f4cd9b4c8cb0cbccd32a..f1b97dfce13b0de976d1659cc9ec134a6137cec9 100644 (file)
@@ -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();