Skip to content

Commit 836c7dc

Browse files
committed
DAG: Fix getNode dropping flags if there's a glue output
The AMDGPU non-strict fdiv lowering needs to introduce an FP mode switch in some cases, and has custom nodes to provide chain/glue for the intermediate FP operations. We need to propagate nofpexcept here, but getNode was dropping the flags. Adding nofpexcept in the AMDGPU custom lowering is left to a future patch. Also fix a second case where flags were dropped, but in this case it seems it just didn't handle this number of operands. Test will be included in future AMDGPU patch.
1 parent f97a609 commit 836c7dc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7444,6 +7444,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
74447444
createOperands(N, Ops);
74457445
}
74467446

7447+
N->setFlags(Flags);
74477448
InsertNode(N);
74487449
SDValue V(N, 0);
74497450
NewSDValueDbgMsg(V, "Creating new node: ", this);
@@ -7525,13 +7526,14 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
75257526
return SDValue(E, 0);
75267527

75277528
N = newSDNode<SDNode>(Opcode, DL.getIROrder(), DL.getDebugLoc(), VTList);
7528-
N->setFlags(Flags);
75297529
createOperands(N, Ops);
75307530
CSEMap.InsertNode(N, IP);
75317531
} else {
75327532
N = newSDNode<SDNode>(Opcode, DL.getIROrder(), DL.getDebugLoc(), VTList);
75337533
createOperands(N, Ops);
75347534
}
7535+
7536+
N->setFlags(Flags);
75357537
InsertNode(N);
75367538
SDValue V(N, 0);
75377539
NewSDValueDbgMsg(V, "Creating new node: ", this);

0 commit comments

Comments
 (0)