From f6a7c8b1fc8f705e7f5561294bc1a945d09c5f83 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Tue, 16 Oct 2018 14:44:50 +0000 Subject: [PATCH] [InstCombine] make sure type is integer before calling ComputeNumSignBits llvm-svn: 344610 --- llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp index 5ffbf83..ecda713 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. -- 2.7.4