If x is known to be nonzero, findLastSet(x) returns the index of the
highest set bit counting from the LSB, so 1 << findLastSet(x) is the
same as llvm::bit_floor(x).
if (ByteVal == 0 || ByteVal == 255
? Bytes <= 16 && llvm::popcount(Bytes) <= 2
: Bytes <= 4) {
- unsigned Size1 = Bytes == 16 ? 8 : 1 << findLastSet(Bytes);
+ unsigned Size1 = Bytes == 16 ? 8 : llvm::bit_floor(Bytes);
unsigned Size2 = Bytes - Size1;
SDValue Chain1 = memsetStore(DAG, DL, Chain, Dst, ByteVal, Size1,
Alignment, DstPtrInfo);