Use llvm::Log2_32 and llvm::Log2_64 instead of llvm::findLastSet (NFC)
authorKazu Hirata <kazu@google.com>
Thu, 26 Jan 2023 05:34:09 +0000 (21:34 -0800)
committerKazu Hirata <kazu@google.com>
Thu, 26 Jan 2023 05:34:09 +0000 (21:34 -0800)
commita5cd202e21e52c1e00963ad5bdfeb83b4fec820e
treeca735b15840c8060c4f02f7ced9273b7521903dd
parent49f7d2c4f0fa105a854c2aee78347652212ace3d
Use llvm::Log2_32 and llvm::Log2_64 instead of llvm::findLastSet (NFC)

For a nonzero argument, llvm::findLastSet(x) is equivalent to
llvm::Log2_32(x) or llvm::Log2_64(x).  None of the calls to
llvm::findLastSet in this patch relies on llvm::findLastSet's ability
to return std::numeric_limits<T>::max() on input 0.
clang-tools-extra/clangd/index/dex/PostingList.cpp
clang/lib/CodeGen/SwiftCallingConv.cpp
llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp