diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1045,25 +1045,25 @@ } // end anonymous namespace // This function is used to enforce the topological node id property -// property leveraged during Instruction selection. Before selection all -// nodes are given a non-negative id such that all nodes have a larger id than +// leveraged during instruction selection. Before the selection process all +// nodes are given a non-negative id such that all nodes have a greater id than // their operands. As this holds transitively we can prune checks that a node N // is a predecessor of M another by not recursively checking through M's -// operands if N's ID is larger than M's ID. This is significantly improves -// performance of for various legality checks (e.g. IsLegalToFold / -// UpdateChains). - -// However, when we fuse multiple nodes into a single node -// during selection we may induce a predecessor relationship between inputs and -// outputs of distinct nodes being merged violating the topological property. -// Should a fused node have a successor which has yet to be selected, our -// legality checks would be incorrect. To avoid this we mark all unselected -// sucessor nodes, i.e. id != -1 as invalid for pruning by bit-negating (x => +// operands if N's ID is larger than M's ID. This significantly improves +// performance of various legality checks (e.g. IsLegalToFold / UpdateChains). + +// However, when we fuse multiple nodes into a single node during the +// selection we may induce a predecessor relationship between inputs and +// outputs of distinct nodes being merged, violating the topological property. +// Should a fused node have a successor which has yet to be selected, +// our legality checks would be incorrect. To avoid this we mark all unselected +// successor nodes, i.e. id != -1, as invalid for pruning by bit-negating (x => // (-(x+1))) the ids and modify our pruning check to ignore negative Ids of M. // We use bit-negation to more clearly enforce that node id -1 can only be -// achieved by selected nodes). As the conversion is reversable the original Id, -// topological pruning can still be leveraged when looking for unselected nodes. -// This method is call internally in all ISel replacement calls. +// achieved by selected nodes. As the conversion is reversable to the original +// Id, topological pruning can still be leveraged when looking for unselected +// nodes. This method is called internally in all ISel replacement related +// functions. void SelectionDAGISel::EnforceNodeIdInvariant(SDNode *Node) { SmallVector Nodes; Nodes.push_back(Node); @@ -1080,7 +1080,7 @@ } } -// InvalidateNodeId - As discusses in EnforceNodeIdInvariant, mark a +// InvalidateNodeId - As explained in EnforceNodeIdInvariant, mark a // NodeId with the equivalent node id which is invalid for topological // pruning. void SelectionDAGISel::InvalidateNodeId(SDNode *N) {