[llvm] [X86] combineAndNotOrIntoAndNotAnd - don't fold other constant operands (PR #113264)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 11:15:03 PDT 2024


================
@@ -50049,8 +50049,8 @@ static SDValue combineAndNotOrIntoAndNotAnd(SDNode *N, SelectionDAG &DAG) {
   SDValue X, Y, Z;
   if (sd_match(N, m_And(m_Value(X),
                         m_OneUse(m_Or(m_Value(Y), m_Not(m_Value(Z))))))) {
-    // Don't fold if Y is a constant to prevent infinite loops.
-    if (!isa<ConstantSDNode>(Y))
----------------
goldsteinn wrote:

Should probably be `isConstantIntBuildVectorOrConstantInt` for both `Y` and `N`.

https://github.com/llvm/llvm-project/pull/113264


More information about the llvm-commits mailing list