diff options
author | Kazu Hirata <kazu@google.com> | 2023-02-19 22:04:47 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-02-19 22:04:47 -0800 |
commit | f8f3db27565cae8e07c2487f9714a32840c6d548 (patch) | |
tree | 163c6d5bb9f3cee2a6b886d21e2faa8b43ed7310 /llvm/unittests/IR/ConstantRangeTest.cpp | |
parent | bc8b6f62caba904e944af9b103972ac7b85a6082 (diff) | |
download | llvm-f8f3db27565cae8e07c2487f9714a32840c6d548.zip llvm-f8f3db27565cae8e07c2487f9714a32840c6d548.tar.gz llvm-f8f3db27565cae8e07c2487f9714a32840c6d548.tar.bz2 |
Use APInt::count{l,r}_{zero,one} (NFC)
Diffstat (limited to 'llvm/unittests/IR/ConstantRangeTest.cpp')
-rw-r--r-- | llvm/unittests/IR/ConstantRangeTest.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/unittests/IR/ConstantRangeTest.cpp b/llvm/unittests/IR/ConstantRangeTest.cpp index 5d1931e..cb7d017 100644 --- a/llvm/unittests/IR/ConstantRangeTest.cpp +++ b/llvm/unittests/IR/ConstantRangeTest.cpp @@ -2398,17 +2398,16 @@ TEST_F(ConstantRangeTest, Abs) { } TEST_F(ConstantRangeTest, Ctlz) { - TestUnaryOpExhaustive([](const ConstantRange &CR) { return CR.ctlz(); }, - [](const APInt &N) { - return APInt(N.getBitWidth(), N.countLeadingZeros()); - }); + TestUnaryOpExhaustive( + [](const ConstantRange &CR) { return CR.ctlz(); }, + [](const APInt &N) { return APInt(N.getBitWidth(), N.countl_zero()); }); TestUnaryOpExhaustive( [](const ConstantRange &CR) { return CR.ctlz(/*ZeroIsPoison=*/true); }, [](const APInt &N) -> std::optional<APInt> { if (N.isZero()) return std::nullopt; - return APInt(N.getBitWidth(), N.countLeadingZeros()); + return APInt(N.getBitWidth(), N.countl_zero()); }); } |