[llvm] 5140e0d - [SelectionDAGISel] Add back a comment to MergeInputChains handling. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 13:00:23 PDT 2022


Author: Craig Topper
Date: 2022-05-05T12:59:21-07:00
New Revision: 5140e0d219be490930810778a6dcc63fbe72eac2

URL: https://github.com/llvm/llvm-project/commit/5140e0d219be490930810778a6dcc63fbe72eac2
DIFF: https://github.com/llvm/llvm-project/commit/5140e0d219be490930810778a6dcc63fbe72eac2.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index a4f20c86e1ec..dab5d3fe68a8 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -3269,6 +3269,8 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
       assert(RecNo < RecordedNodes.size() && "Invalid EmitMergeInputChains");
       ChainNodesMatched.push_back(RecordedNodes[RecNo].first.getNode());
 
+      // If the chained node is not the root, we can't fold it if it has
+      // multiple uses.
       // FIXME: What if other value results of the node have uses not matched
       // by this pattern?
       if (ChainNodesMatched.back() != NodeToMatch &&
@@ -3306,6 +3308,8 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
         assert(RecNo < RecordedNodes.size() && "Invalid EmitMergeInputChains");
         ChainNodesMatched.push_back(RecordedNodes[RecNo].first.getNode());
 
+        // If the chained node is not the root, we can't fold it if it has
+        // multiple uses.
         // FIXME: What if other value results of the node have uses not matched
         // by this pattern?
         if (ChainNodesMatched.back() != NodeToMatch &&


        


More information about the llvm-commits mailing list