[llvm] [DAG] Add SpecificFP matcher (PR #167438)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 10 17:49:12 PST 2025
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 origin/main HEAD --extensions h,cpp -- llvm/include/llvm/CodeGen/SDPatternMatch.h llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/CodeGen/SDPatternMatch.h b/llvm/include/llvm/CodeGen/SDPatternMatch.h
index 730234d68..ee3094327 100644
--- a/llvm/include/llvm/CodeGen/SDPatternMatch.h
+++ b/llvm/include/llvm/CodeGen/SDPatternMatch.h
@@ -1163,9 +1163,7 @@ inline SpecificFP_match m_SpecificFP(APFloat V) {
return SpecificFP_match(V.convertToDouble());
}
-inline SpecificFP_match m_SpecificFP(double V) {
- return SpecificFP_match(V);
-}
+inline SpecificFP_match m_SpecificFP(double V) { return SpecificFP_match(V); }
struct Zero_match {
bool AllowUndefs;
diff --git a/llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp b/llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp
index a8920976f..dff1c4e9e 100644
--- a/llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp
+++ b/llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp
@@ -365,7 +365,8 @@ TEST_F(SelectionDAGPatternMatchTest, matchSpecificFpOp) {
using namespace SDPatternMatch;
EXPECT_TRUE(sd_match(Op0, m_SpecificFP(Value)));
- EXPECT_TRUE(sd_match(FAdd, m_BinOp(ISD::FADD, m_Specific(Op1), m_SpecificFP(Value))));
+ EXPECT_TRUE(
+ sd_match(FAdd, m_BinOp(ISD::FADD, m_Specific(Op1), m_SpecificFP(Value))));
}
TEST_F(SelectionDAGPatternMatchTest, matchGenericTernaryOp) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/167438
More information about the llvm-commits
mailing list