Skip to content

Commit 5140e0d

Browse files
committed
[SelectionDAGISel] Add back a comment to MergeInputChains handling. NFC
This comment used to exist, but was lost in a refactor over 10 years ago, but still seems relevant and improves readability.
1 parent 98616cf commit 5140e0d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,6 +3269,8 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
32693269
assert(RecNo < RecordedNodes.size() && "Invalid EmitMergeInputChains");
32703270
ChainNodesMatched.push_back(RecordedNodes[RecNo].first.getNode());
32713271

3272+
// If the chained node is not the root, we can't fold it if it has
3273+
// multiple uses.
32723274
// FIXME: What if other value results of the node have uses not matched
32733275
// by this pattern?
32743276
if (ChainNodesMatched.back() != NodeToMatch &&
@@ -3306,6 +3308,8 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
33063308
assert(RecNo < RecordedNodes.size() && "Invalid EmitMergeInputChains");
33073309
ChainNodesMatched.push_back(RecordedNodes[RecNo].first.getNode());
33083310

3311+
// If the chained node is not the root, we can't fold it if it has
3312+
// multiple uses.
33093313
// FIXME: What if other value results of the node have uses not matched
33103314
// by this pattern?
33113315
if (ChainNodesMatched.back() != NodeToMatch &&

0 commit comments

Comments
 (0)