summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-01-24 22:10:02 -0800
committerKazu Hirata <kazu@google.com>2023-01-24 22:10:03 -0800
commitd5248a46faed9071adffc65f82cac9bc0769b882 (patch)
tree39758a58ad5408a3720cca36c3f3e62ffc99eb5b
parentb3de316420374536def0cc3bfb7d317db9fc830c (diff)
downloadllvm-d5248a46faed9071adffc65f82cac9bc0769b882.tar.gz
[SystemZ] Use llvm::bit_floor (NFC)
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).
-rw-r--r--llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp b/llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp
index 20bab8991144..4eb58e27f7ad 100644
--- a/llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp
@@ -108,7 +108,7 @@ SDValue SystemZSelectionDAGInfo::EmitTargetCodeForMemset(
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);