forked from OSchip/llvm-project
[ValueTracking] Remove unnecessary temporary APInt from computeNumSignBitsVectorConstant.
We can just use getNumSignBits instead of inverting negative numbers. llvm-svn: 316266
This commit is contained in:
parent
b98ee58511
commit
8e8b6efdc8
|
@ -2097,11 +2097,7 @@ static unsigned computeNumSignBitsVectorConstant(const Value *V,
|
|||
if (!Elt)
|
||||
return 0;
|
||||
|
||||
// If the sign bit is 1, flip the bits, so we always count leading zeros.
|
||||
APInt EltVal = Elt->getValue();
|
||||
if (EltVal.isNegative())
|
||||
EltVal = ~EltVal;
|
||||
MinSignBits = std::min(MinSignBits, EltVal.countLeadingZeros());
|
||||
MinSignBits = std::min(MinSignBits, Elt->getValue().getNumSignBits());
|
||||
}
|
||||
|
||||
return MinSignBits;
|
||||
|
|
Loading…
Reference in New Issue