Skip to content

Conversation

@ravil-mobile
Copy link
Contributor

This patch introduces SpeficFP matcher for SelectionDAG nodes.

This includes:

Adding SpecificFP_match() in SDPatternMatch.h.
Adding test coverage in SelectionDAGPatternMatchTest.cpp.

Closes #165566

@ravil-mobile ravil-mobile requested a review from RKSimon November 11, 2025 01:48
@github-actions
Copy link

github-actions bot commented Nov 11, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

if (const auto *CFP = dyn_cast<ConstantFPSDNode>(V.getNode()))
if (CFP->isExactlyValue(Val))
return true;
return false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to add splat handling as well?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to use m_c_BinOp if you want to test for commutation - otherwise you need to swap the operand matchers (or you can add another test and do both!)

Copy link
Collaborator

@RKSimon RKSimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix unit tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DAG] SDPatternMatch - add generic m_SpecificFP(double) / SpecificFP_match matcher

2 participants