@@ -50035,31 +50035,6 @@ static bool hasBZHI(const X86Subtarget &Subtarget, MVT VT) {
5003550035 (VT == MVT::i32 || (VT == MVT::i64 && Subtarget.is64Bit()));
5003650036}
5003750037
50038- /// Folds (and X, (or Y, ~Z)) --> (and X, ~(and ~Y, Z))
50039- /// This undoes the inverse fold performed in InstCombine
50040- static SDValue combineAndNotOrIntoAndNotAnd(SDNode *N, SelectionDAG &DAG) {
50041-
50042- using namespace llvm::SDPatternMatch;
50043- MVT VT = N->getSimpleValueType(0);
50044- SDLoc DL(N);
50045- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
50046- if (!TLI.hasAndNot(SDValue(N, 0)))
50047- return SDValue();
50048-
50049- SDValue X, Y, Z;
50050- if (sd_match(N, m_And(m_Value(X),
50051- m_OneUse(m_Or(m_Value(Y), m_Not(m_Value(Z))))))) {
50052- // Don't fold if Y is a constant to prevent infinite loops.
50053- if (!isa<ConstantSDNode>(Y))
50054- return DAG.getNode(
50055- ISD::AND, DL, VT, X,
50056- DAG.getNOT(
50057- DL, DAG.getNode(ISD::AND, DL, VT, DAG.getNOT(DL, Y, VT), Z), VT));
50058- }
50059-
50060- return SDValue();
50061- }
50062-
5006350038// This function recognizes cases where X86 bzhi instruction can replace and
5006450039// 'and-load' sequence.
5006550040// In case of loading integer value from an array of constants which is defined
@@ -50551,9 +50526,6 @@ static SDValue combineAnd(SDNode *N, SelectionDAG &DAG,
5055150526 if (SDValue R = combineAndLoadToBZHI(N, DAG, Subtarget))
5055250527 return R;
5055350528
50554- if (SDValue R = combineAndNotOrIntoAndNotAnd(N, DAG))
50555- return R;
50556-
5055750529 // fold (and (mul x, c1), c2) -> (mul x, (and c1, c2))
5055850530 // iff c2 is all/no bits mask - i.e. a select-with-zero mask.
5055950531 // TODO: Handle PMULDQ/PMULUDQ/VPMADDWD/VPMADDUBSW?
0 commit comments