[llvm] [IR][PatternMatch] Make `m_Checked{Int,Fp}` accept `Constant *` output instead of `APInt *` (PR #91377)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 11:36:34 PDT 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 45fed80b15df85cee53d3d31a7a46ae0daa91a3f 98fe785cbccd0b2feae55bfd3211b3582afe42e8 -- llvm/include/llvm/IR/PatternMatch.h llvm/unittests/IR/PatternMatch.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/unittests/IR/PatternMatch.cpp b/llvm/unittests/IR/PatternMatch.cpp
index 6e79d5cd8e..effe5c5330 100644
--- a/llvm/unittests/IR/PatternMatch.cpp
+++ b/llvm/unittests/IR/PatternMatch.cpp
@@ -614,7 +614,7 @@ TEST_F(PatternMatchTest, BitCast) {
 TEST_F(PatternMatchTest, CheckedInt) {
   Type *I8Ty = IRB.getInt8Ty();
   const APInt *Res = nullptr;
-  const Constant * CRes = nullptr;
+  const Constant *CRes = nullptr;
   auto CheckUgt1 = [](const APInt &C) { return C.ugt(1); };
   auto CheckTrue = [](const APInt &) { return true; };
   auto CheckFalse = [](const APInt &) { return false; };
@@ -723,8 +723,7 @@ TEST_F(PatternMatchTest, CheckedInt) {
 
     CRes = nullptr;
     Res = nullptr;
-    bool Expec =
-        !(HasUndef && !UndefAsPoison) && Okay.value_or(false);
+    bool Expec = !(HasUndef && !UndefAsPoison) && Okay.value_or(false);
     EXPECT_EQ(Expec, m_CheckedInt(CRes, CheckFn).match(C));
     if (Expec) {
       EXPECT_NE(CRes, nullptr);

``````````

</details>


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


More information about the llvm-commits mailing list