Skip to content

Commit f086941

Browse files
[SelectionDAGISel] small cleanup to INLINEASM_BR selection. NFC
Summary: This code was throwing away the opcode for a boolean, which was then reconstructing the opcode from that boolean. Just pass the opcode, and forget the boolean. Reviewers: srhines Reviewed By: srhines Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77100
1 parent 51475e4 commit f086941

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

llvm/include/llvm/CodeGen/SelectionDAGISel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ class SelectionDAGISel : public MachineFunctionPass {
318318
private:
319319

320320
// Calls to these functions are generated by tblgen.
321-
void Select_INLINEASM(SDNode *N, bool Branch);
321+
void Select_INLINEASM(SDNode *N);
322322
void Select_READ_REGISTER(SDNode *Op);
323323
void Select_WRITE_REGISTER(SDNode *Op);
324324
void Select_UNDEF(SDNode *N);

llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,14 +2239,14 @@ bool SelectionDAGISel::IsLegalToFold(SDValue N, SDNode *U, SDNode *Root,
22392239
return !findNonImmUse(Root, N.getNode(), U, IgnoreChains);
22402240
}
22412241

2242-
void SelectionDAGISel::Select_INLINEASM(SDNode *N, bool Branch) {
2242+
void SelectionDAGISel::Select_INLINEASM(SDNode *N) {
22432243
SDLoc DL(N);
22442244

22452245
std::vector<SDValue> Ops(N->op_begin(), N->op_end());
22462246
SelectInlineAsmMemoryOperands(Ops, DL);
22472247

22482248
const EVT VTs[] = {MVT::Other, MVT::Glue};
2249-
SDValue New = CurDAG->getNode(Branch ? ISD::INLINEASM_BR : ISD::INLINEASM, DL, VTs, Ops);
2249+
SDValue New = CurDAG->getNode(N->getOpcode(), DL, VTs, Ops);
22502250
New->setNodeId(-1);
22512251
ReplaceUses(N, New.getNode());
22522252
CurDAG->RemoveDeadNode(N);
@@ -2822,8 +2822,7 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
28222822
return;
28232823
case ISD::INLINEASM:
28242824
case ISD::INLINEASM_BR:
2825-
Select_INLINEASM(NodeToMatch,
2826-
NodeToMatch->getOpcode() == ISD::INLINEASM_BR);
2825+
Select_INLINEASM(NodeToMatch);
28272826
return;
28282827
case ISD::READ_REGISTER:
28292828
Select_READ_REGISTER(NodeToMatch);

0 commit comments

Comments
 (0)