aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-04-19 16:56:24 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-04-19 16:56:24 +0000
commitec1bb4fdaf531cbca7b3707b867a6d40068f8ff9 (patch)
tree378bbf484841a014c24192d242e990bbc35c76ed /llvm/lib/Analysis/ConstantFolding.cpp
parent2fd1d7aee3cc168e0d9b78ca53fb2c1fc6684705 (diff)
downloadllvm-ec1bb4fdaf531cbca7b3707b867a6d40068f8ff9.zip
llvm-ec1bb4fdaf531cbca7b3707b867a6d40068f8ff9.tar.gz
llvm-ec1bb4fdaf531cbca7b3707b867a6d40068f8ff9.tar.bz2
ConstantFolding: ComputeMaskedBits wants the scalar size for vectors.
Fixes PR15791. llvm-svn: 179859
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index b5286e8..bc0dffc 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -551,7 +551,7 @@ static Constant *SymbolicallyEvaluateBinop(unsigned Opc, Constant *Op0,
if (Opc == Instruction::And && DL) {
- unsigned BitWidth = DL->getTypeSizeInBits(Op0->getType());
+ unsigned BitWidth = DL->getTypeSizeInBits(Op0->getType()->getScalarType());
APInt KnownZero0(BitWidth, 0), KnownOne0(BitWidth, 0);
APInt KnownZero1(BitWidth, 0), KnownOne1(BitWidth, 0);
ComputeMaskedBits(Op0, KnownZero0, KnownOne0, DL);