[llvm] r344610 - [InstCombine] make sure type is integer before calling ComputeNumSignBits
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 16 07:44:50 PDT 2018
Author: spatel
Date: Tue Oct 16 07:44:50 2018
New Revision: 344610
URL: http://llvm.org/viewvc/llvm-project?rev=344610&view=rev
Log:
[InstCombine] make sure type is integer before calling ComputeNumSignBits
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp?rev=344610&r1=344609&r2=344610&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp Tue Oct 16 07:44:50 2018
@@ -1834,7 +1834,8 @@ static bool areInverseVectorBitmasks(Con
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.
More information about the llvm-commits
mailing list