[llvm] [DAG] Add SpecificFP matcher (PR #167438)
Ravil Dorozhinskii via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 19 16:58:36 PST 2025
================
@@ -1144,6 +1144,27 @@ inline SpecificInt_match m_SpecificInt(uint64_t V) {
return SpecificInt_match(APInt(64, V));
}
+struct SpecificFP_match {
+ double Val;
+
+ explicit SpecificFP_match(double V) : Val(V) {}
+
+ template <typename MatchContext>
+ bool match(const MatchContext &Ctx, SDValue V) {
+ if (const auto *CFP = dyn_cast<ConstantFPSDNode>(V.getNode()))
+ if (CFP->isExactlyValue(Val))
+ return true;
+ return false;
----------------
ravil-mobile wrote:
Yes. I added. Could you, please, have a look?
https://github.com/llvm/llvm-project/pull/167438
More information about the llvm-commits
mailing list