[llvm] c5a17e6 - [DAGCombiner] Use APInt::isSubsetOf. NFC (#142029)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 30 09:01:39 PDT 2025


Author: Craig Topper
Date: 2025-05-30T09:01:36-07:00
New Revision: c5a17e6bea679f7c84dbdd412432f126e03f328e

URL: https://github.com/llvm/llvm-project/commit/c5a17e6bea679f7c84dbdd412432f126e03f328e
DIFF: https://github.com/llvm/llvm-project/commit/c5a17e6bea679f7c84dbdd412432f126e03f328e.diff

LOG: [DAGCombiner] Use APInt::isSubsetOf. NFC (#142029)

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index be2209a2f8faf..8fd222ad2578b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -6813,7 +6813,7 @@ bool DAGCombiner::SearchForAndLoads(SDNode *N,
     // Some constants may need fixing up later if they are too large.
     if (auto *C = dyn_cast<ConstantSDNode>(Op)) {
       if ((N->getOpcode() == ISD::OR || N->getOpcode() == ISD::XOR) &&
-          (Mask->getAPIntValue() & C->getAPIntValue()) != C->getAPIntValue())
+          !C->getAPIntValue().isSubsetOf(Mask->getAPIntValue()))
         NodesWithConsts.insert(N);
       continue;
     }


        


More information about the llvm-commits mailing list