Skip to content

Commit fa16ae7

Browse files
[DAG] revert
1 parent c60fcce commit fa16ae7

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18369,13 +18369,11 @@ template <class MatchContextClass> SDValue DAGCombiner::visitFMA(SDNode *N) {
1836918369
}
1837018370
}
1837118371

18372-
SDValue X, Y;
18373-
18374-
// (fma 1.0, X, Y) or (fma X, 1.0, Y) -> (fadd X, Y)
18375-
SDValue C1 = DAG.getConstantFP(1.0, DL, VT);
18376-
if (sd_match(N,
18377-
m_c_TernaryOp(ISD::FMA, m_Specific(C1), m_Value(X), m_Value(Y))))
18378-
return matcher.getNode(ISD::FADD, DL, VT, X, Y);
18372+
// FIXME: Support splat of constant.
18373+
if (N0CFP && N0CFP->isExactlyValue(1.0))
18374+
return matcher.getNode(ISD::FADD, DL, VT, N1, N2);
18375+
if (N1CFP && N1CFP->isExactlyValue(1.0))
18376+
return matcher.getNode(ISD::FADD, DL, VT, N0, N2);
1837918377

1838018378
// Canonicalize (fma c, x, y) -> (fma x, c, y)
1838118379
if (DAG.isConstantFPBuildVectorOrConstantFP(N0) &&

0 commit comments

Comments
 (0)