summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-10-16 14:44:50 +0000
committerSanjay Patel <spatel@rotateright.com>2018-10-16 14:44:50 +0000
commitf6a7c8b1fc8f705e7f5561294bc1a945d09c5f83 (patch)
tree00525bebc2dde31133ab52f9a1b19a3ee39bac3c /llvm/lib/Transforms/InstCombine
parent0c48c977b84c91d4c1812bed7b2dc6b5fc376281 (diff)
downloadbcm5719-llvm-f6a7c8b1fc8f705e7f5561294bc1a945d09c5f83.tar.gz
bcm5719-llvm-f6a7c8b1fc8f705e7f5561294bc1a945d09c5f83.zip
[InstCombine] make sure type is integer before calling ComputeNumSignBits
llvm-svn: 344610
Diffstat (limited to 'llvm/lib/Transforms/InstCombine')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index 5ffbf83508c..ecda713a6bc 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -1834,7 +1834,8 @@ static bool areInverseVectorBitmasks(Constant *C1, Constant *C2) {
Value *InstCombiner::getSelectCondition(Value *A, Value *B) {
// Step 1: We need 0 or all-1's bitmasks.
Type *Ty = A->getType();
- if (ComputeNumSignBits(A) != Ty->getScalarSizeInBits())
+ if (Ty->isIntOrIntVectorTy() &&
+ ComputeNumSignBits(A) != Ty->getScalarSizeInBits())
return nullptr;
// Step 2: If B is the 'not' value of A, we have our answer.
OpenPOWER on IntegriCloud