[llvm] [KnownBits] Implement knownbits lshr/ashr with exact flag (PR #84254)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 15:02:41 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff f95a76391c527ba23574cb1d8d8803c9a1d0b7c4 40ae0a4adf7ef9ffbf6f9588471412bbf4c317d4 -- llvm/include/llvm/Support/KnownBits.h llvm/lib/Analysis/ValueTracking.cpp llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/lib/Support/KnownBits.cpp llvm/unittests/Support/KnownBitsTest.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/unittests/Support/KnownBitsTest.cpp b/llvm/unittests/Support/KnownBitsTest.cpp
index 1816fa8bc4..41a5338125 100644
--- a/llvm/unittests/Support/KnownBitsTest.cpp
+++ b/llvm/unittests/Support/KnownBitsTest.cpp
@@ -321,17 +321,17 @@ TEST(KnownBitsTest, AbsDiffSpecialCase) {
 }
 
 TEST(KnownBitsTest, ShrExactSpecialCase) {
-    const unsigned N = 4;
-    KnownBits LHS(N), RHS(N);
+  const unsigned N = 4;
+  KnownBits LHS(N), RHS(N);
 
-    LHS.One.setBit(1);
-    LHS.One.setBit(2);
+  LHS.One.setBit(1);
+  LHS.One.setBit(2);
 
-    EXPECT_FALSE(KnownBits::lshr(LHS, RHS).One[1]);
-    EXPECT_FALSE(KnownBits::ashr(LHS, RHS).One[1]);
+  EXPECT_FALSE(KnownBits::lshr(LHS, RHS).One[1]);
+  EXPECT_FALSE(KnownBits::ashr(LHS, RHS).One[1]);
 
-    EXPECT_FALSE(KnownBits::lshr(LHS, RHS).One[1]);
-    EXPECT_FALSE(KnownBits::ashr(LHS, RHS).One[1]);        
+  EXPECT_FALSE(KnownBits::lshr(LHS, RHS).One[1]);
+  EXPECT_FALSE(KnownBits::ashr(LHS, RHS).One[1]);
 }
 
 TEST(KnownBitsTest, BinaryExhaustive) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/84254


More information about the llvm-commits mailing list