[llvm] [DAG] SDPatternMatch m_Zero/m_One/m_AllOnes have inconsistent undef h… (PR #147044)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 7 18:46:36 PDT 2025
================
@@ -825,3 +825,89 @@ TEST_F(SelectionDAGPatternMatchTest, matchReassociatableOp) {
EXPECT_FALSE(sd_match(
ORS0123, m_ReassociatableOr(m_Value(), m_Value(), m_Value(), m_Value())));
}
+
+TEST_F(SelectionDAGPatternMatchTest, MatchZeroOneAllOnes) {
+ using namespace SDPatternMatch;
+
+ SDLoc DL;
+ EVT VT = EVT::getIntegerVT(Context, 32);
+
+ // Scalar constant 0
+ SDValue Zero = DAG->getConstant(0, DL, VT);
+ EXPECT_TRUE(sd_match(Zero, DAG.get(), llvm::SDPatternMatch::m_Zero()));
----------------
woruyu wrote:
Good catch — I missed that during cleanup. I’ll send a follow-up patch to remove the redundant prefix.
https://github.com/llvm/llvm-project/pull/147044
More information about the llvm-commits
mailing list