Skip to content

Commit

Permalink
remove useless declaration, clone_nodes -> clone_data_nodes, add asse…
Browse files Browse the repository at this point in the history
…rtion to prevent double-usage of clone()
  • Loading branch information
chhagedorn committed Mar 4, 2024
1 parent 79b8b27 commit 14b46ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/hotspot/share/opto/loopnode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
class CmpNode;
class BaseCountedLoopEndNode;
class CountedLoopNode;
class DataInputGraph;
class IdealLoopTree;
class LoopNode;
class Node;
Expand Down Expand Up @@ -1906,14 +1905,15 @@ class DataNodeGraph : public StackObj {

private:
void clone(Node* node, Node* new_ctrl);
void clone_nodes(Node* new_ctrl);
void clone_data_nodes(Node* new_ctrl);
void rewire_clones_to_cloned_inputs();

public:
// Clone the provided data node collection and rewire the clones in such a way to create an identical graph copy.
// Set `new_ctrl` as ctrl for the cloned nodes.
const OrigToNewHashtable& clone(Node* new_ctrl) {
clone_nodes(new_ctrl);
assert(_orig_to_new.number_of_entries() == 0, "should not call this method twice in a row");
clone_data_nodes(new_ctrl);
rewire_clones_to_cloned_inputs();
return _orig_to_new;
}
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/share/opto/loopopts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4496,8 +4496,7 @@ void PhaseIdealLoop::move_unordered_reduction_out_of_loop(IdealLoopTree* loop) {
}
}

// Clone all nodes in _data_nodes.
void DataNodeGraph::clone_nodes(Node* new_ctrl) {
void DataNodeGraph::clone_data_nodes(Node* new_ctrl) {
for (uint i = 0; i < _data_nodes.size(); i++) {
clone(_data_nodes[i], new_ctrl);
}
Expand Down

0 comments on commit 14b46ba

Please sign in to comment.