From: Sanjay Patel Date: Tue, 16 Oct 2018 14:44:50 +0000 (+0000) Subject: [InstCombine] make sure type is integer before calling ComputeNumSignBits X-Git-Tag: llvmorg-8.0.0-rc1~6430 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6a7c8b1fc8f705e7f5561294bc1a945d09c5f83;p=platform%2Fupstream%2Fllvm.git [InstCombine] make sure type is integer before calling ComputeNumSignBits llvm-svn: 344610 --- 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.