Skip to content

Commit 4b5111a

Browse files
committed
propagate fmf in br_cc
1 parent adcad6a commit 4b5111a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19279,13 +19279,13 @@ SDValue DAGCombiner::visitBRCOND(SDNode *N) {
1927919279
// MachineBasicBlock CFG, which is awkward.
1928019280

1928119281
// fold a brcond with a setcc condition into a BR_CC node if BR_CC is legal
19282-
// on the target.
19282+
// on the target, also copy fast math flags.
1928319283
if (N1.getOpcode() == ISD::SETCC &&
1928419284
TLI.isOperationLegalOrCustom(ISD::BR_CC,
1928519285
N1.getOperand(0).getValueType())) {
19286-
return DAG.getNode(ISD::BR_CC, SDLoc(N), MVT::Other,
19287-
Chain, N1.getOperand(2),
19288-
N1.getOperand(0), N1.getOperand(1), N2);
19286+
return DAG.getNode(ISD::BR_CC, SDLoc(N), MVT::Other, Chain,
19287+
N1.getOperand(2), N1.getOperand(0), N1.getOperand(1), N2,
19288+
N1->getFlags());
1928919289
}
1929019290

1929119291
if (N1.hasOneUse()) {

0 commit comments

Comments
 (0)