diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/IR/ConstantFold.cpp | 3 | 
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp index 9124c111935..b96d1540d71 100644 --- a/llvm/lib/IR/ConstantFold.cpp +++ b/llvm/lib/IR/ConstantFold.cpp @@ -674,6 +674,9 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, Constant *V,      }      return nullptr;    case Instruction::Trunc: { +    if (V->getType()->isVectorTy()) +      return nullptr; +      uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth();      if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {        return ConstantInt::get(V->getContext(),  | 

