diff options
author | Kazu Hirata <kazu@google.com> | 2023-01-28 12:41:19 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-01-28 12:41:20 -0800 |
commit | 55e2cd16095d64e9afca6e109e40ed95d735dc7f (patch) | |
tree | c61699df07a76b98d99ed93dfb95d0e003b0956a /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | a536d3e40e088ab725c6d2e6c0b8ca21451b511c (diff) | |
download | llvm-55e2cd16095d64e9afca6e109e40ed95d735dc7f.zip llvm-55e2cd16095d64e9afca6e109e40ed95d735dc7f.tar.gz llvm-55e2cd16095d64e9afca6e109e40ed95d735dc7f.tar.bz2 |
Use llvm::count{lr}_{zero,one} (NFC)
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 9e04839..372a669 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1086,7 +1086,7 @@ static void GetBranchWeights(Instruction *TI, static void FitWeights(MutableArrayRef<uint64_t> Weights) { uint64_t Max = *std::max_element(Weights.begin(), Weights.end()); if (Max > UINT_MAX) { - unsigned Offset = 32 - countLeadingZeros(Max); + unsigned Offset = 32 - llvm::countl_zero(Max); for (uint64_t &I : Weights) I >>= Offset; } @@ -6694,7 +6694,7 @@ static bool ReduceSwitchRange(SwitchInst *SI, IRBuilder<> &Builder, // less than 64. unsigned Shift = 64; for (auto &V : Values) - Shift = std::min(Shift, countTrailingZeros((uint64_t)V)); + Shift = std::min(Shift, (unsigned)llvm::countr_zero((uint64_t)V)); assert(Shift < 64); if (Shift > 0) for (auto &V : Values) |