summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-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