[llvm] df34581 - [RISCV] Use llvm::Log2_64 (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 28 11:33:09 PST 2023
Author: Kazu Hirata
Date: 2023-01-28T11:33:02-08:00
New Revision: df34581d2b004e20fda85b4c8617bf436e826f6c
URL: https://github.com/llvm/llvm-project/commit/df34581d2b004e20fda85b4c8617bf436e826f6c
DIFF: https://github.com/llvm/llvm-project/commit/df34581d2b004e20fda85b4c8617bf436e826f6c.diff
LOG: [RISCV] Use llvm::Log2_64 (NFC)
Added:
Modified:
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
index cf903570b7b0..aac23f021b81 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
@@ -104,7 +104,7 @@ def BSETINVTwoBitsMask : PatLeaf<(imm), [{
def BSETINVTwoBitsMaskHigh : SDNodeXForm<imm, [{
uint64_t I = N->getZExtValue();
- return CurDAG->getTargetConstant(63 - llvm::countl_zero(I), SDLoc(N),
+ return CurDAG->getTargetConstant(llvm::Log2_64(I), SDLoc(N),
N->getValueType(0));
}]>;
@@ -146,7 +146,7 @@ def BCLRITwoBitsMaskHigh : SDNodeXForm<imm, [{
uint64_t I = N->getSExtValue();
if (!Subtarget->is64Bit())
I |= 0xffffffffull << 32;
- return CurDAG->getTargetConstant(63 - llvm::countl_zero(~I), SDLoc(N),
+ return CurDAG->getTargetConstant(llvm::Log2_64(~I), SDLoc(N),
N->getValueType(0));
}]>;
More information about the llvm-commits
mailing list