[llvm] [SDPatternMatch] Add `m_ConstInt` overloads with `uint64_t`/`int64_t` operands (PR #182615)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 20 15:06:21 PST 2026
================
@@ -1159,11 +1159,60 @@ struct ConstantInt_match {
BindVal ? *BindVal : Discard);
}
};
+
+struct ConstantUnsigned64_match {
+ uint64_t &BindVal;
+
+ explicit ConstantUnsigned64_match(uint64_t &V) : BindVal(V) {}
+
+ template <typename MatchContext>
+ bool match(const MatchContext &Ctx, SDValue N) {
+ APInt V;
+ if (!ConstantInt_match(&V).match(Ctx, N))
+ return false;
+ if (V.getActiveBits() > 64)
----------------
topperc wrote:
Use tryZExtValue()?
https://github.com/llvm/llvm-project/pull/182615
More information about the llvm-commits
mailing list