aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/KnownBitsTest.cpp
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2024-09-30 13:09:06 -0500
committerNoah Goldstein <goldstein.w.n@gmail.com>2024-09-30 13:10:16 -0500
commitbbdca53bad670b69e299b1094e2d654a3a76e0dd (patch)
tree7340d937b1f6f02c71f479bcc9a79bdcbf4e4e45 /llvm/unittests/Support/KnownBitsTest.cpp
parent85181788576151cc4b52d38d9b52d04f26179530 (diff)
downloadllvm-bbdca53bad670b69e299b1094e2d654a3a76e0dd.zip
llvm-bbdca53bad670b69e299b1094e2d654a3a76e0dd.tar.gz
llvm-bbdca53bad670b69e299b1094e2d654a3a76e0dd.tar.bz2
[KnownBitsTest] Add optimality tests to some optimal impls; NFC
Adding optimality test to `add`, `sub`, `avgCeilU` and `avgFloorU`
Diffstat (limited to 'llvm/unittests/Support/KnownBitsTest.cpp')
-rw-r--r--llvm/unittests/Support/KnownBitsTest.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/llvm/unittests/Support/KnownBitsTest.cpp b/llvm/unittests/Support/KnownBitsTest.cpp
index b6e16f8..b701757 100644
--- a/llvm/unittests/Support/KnownBitsTest.cpp
+++ b/llvm/unittests/Support/KnownBitsTest.cpp
@@ -305,15 +305,13 @@ TEST(KnownBitsTest, BinaryExhaustive) {
[](const KnownBits &Known1, const KnownBits &Known2) {
return KnownBits::add(Known1, Known2);
},
- [](const APInt &N1, const APInt &N2) { return N1 + N2; },
- /*CheckOptimality=*/false);
+ [](const APInt &N1, const APInt &N2) { return N1 + N2; });
testBinaryOpExhaustive(
"sub",
[](const KnownBits &Known1, const KnownBits &Known2) {
return KnownBits::sub(Known1, Known2);
},
- [](const APInt &N1, const APInt &N2) { return N1 - N2; },
- /*CheckOptimality=*/false);
+ [](const APInt &N1, const APInt &N2) { return N1 - N2; });
testBinaryOpExhaustive("umax", KnownBits::umax, APIntOps::umax);
testBinaryOpExhaustive("umin", KnownBits::umin, APIntOps::umin);
testBinaryOpExhaustive("smax", KnownBits::smax, APIntOps::smax);
@@ -524,16 +522,15 @@ TEST(KnownBitsTest, BinaryExhaustive) {
/*CheckOptimality=*/false);
testBinaryOpExhaustive("avgFloorS", KnownBits::avgFloorS, APIntOps::avgFloorS,
- false);
+ /*CheckOptimality=*/false);
- testBinaryOpExhaustive("avgFloorU", KnownBits::avgFloorU, APIntOps::avgFloorU,
- false);
+ testBinaryOpExhaustive("avgFloorU", KnownBits::avgFloorU,
+ APIntOps::avgFloorU);
- testBinaryOpExhaustive("avgCeilU", KnownBits::avgCeilU, APIntOps::avgCeilU,
- false);
+ testBinaryOpExhaustive("avgCeilU", KnownBits::avgCeilU, APIntOps::avgCeilU);
testBinaryOpExhaustive("avgCeilS", KnownBits::avgCeilS, APIntOps::avgCeilS,
- false);
+ /*CheckOptimality=*/false);
}
TEST(KnownBitsTest, UnaryExhaustive) {