diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index e05f85ea3bd8e..00be9891b0ccb 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(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; }