diff options
author | Jay Foad <jay.foad@amd.com> | 2024-10-01 19:34:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-01 19:34:50 +0100 |
commit | 5cabf1505d2180083ae3cf34abd79924cbcdbdbf (patch) | |
tree | 32d19d9eea4272fb1fbb02df75dd2b9d2424835e /llvm/unittests/Support/KnownBitsTest.cpp | |
parent | 9c72a9db7b6f81c1c902b8e691bf079652afa540 (diff) | |
download | llvm-5cabf1505d2180083ae3cf34abd79924cbcdbdbf.zip llvm-5cabf1505d2180083ae3cf34abd79924cbcdbdbf.tar.gz llvm-5cabf1505d2180083ae3cf34abd79924cbcdbdbf.tar.bz2 |
[KnownBits] Make `avg{Ceil,Floor}S` optimal (#110688)
Rewrite the signed functions in terms of the unsigned ones which are
already optimal.
Diffstat (limited to 'llvm/unittests/Support/KnownBitsTest.cpp')
-rw-r--r-- | llvm/unittests/Support/KnownBitsTest.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/unittests/Support/KnownBitsTest.cpp b/llvm/unittests/Support/KnownBitsTest.cpp index b701757..551c1a8 100644 --- a/llvm/unittests/Support/KnownBitsTest.cpp +++ b/llvm/unittests/Support/KnownBitsTest.cpp @@ -521,16 +521,15 @@ TEST(KnownBitsTest, BinaryExhaustive) { [](const APInt &N1, const APInt &N2) { return APIntOps::mulhu(N1, N2); }, /*CheckOptimality=*/false); - testBinaryOpExhaustive("avgFloorS", KnownBits::avgFloorS, APIntOps::avgFloorS, - /*CheckOptimality=*/false); + testBinaryOpExhaustive("avgFloorS", KnownBits::avgFloorS, + APIntOps::avgFloorS); testBinaryOpExhaustive("avgFloorU", KnownBits::avgFloorU, APIntOps::avgFloorU); testBinaryOpExhaustive("avgCeilU", KnownBits::avgCeilU, APIntOps::avgCeilU); - testBinaryOpExhaustive("avgCeilS", KnownBits::avgCeilS, APIntOps::avgCeilS, - /*CheckOptimality=*/false); + testBinaryOpExhaustive("avgCeilS", KnownBits::avgCeilS, APIntOps::avgCeilS); } TEST(KnownBitsTest, UnaryExhaustive) { |