RFR: 8327109: Refactor data graph cloning used in create_new_if_for_predicate() into separate class

Emanuel Peter epeter at openjdk.org
Fri Mar 1 14:14:56 UTC 2024


On Fri, 1 Mar 2024 13:56:52 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/loopnode.hpp line 1889:
>> 
>>> 1887: //   1. Clone the data nodes
>>> 1888: //   2. Fix the cloned data inputs pointing to the old nodes to the cloned inputs by using an old->new mapping.
>>> 1889: class DataNodeGraph : public StackObj {
>> 
>> You could have a typedef for `ResizeableResourceHashtable<Node*, Node*, AnyObj::RESOURCE_AREA, mtCompiler>`. Then you don't need to use `auto` for it elsewhere, and it is clear what it is.
>> Suggestion: `OrigToNewHashtable`.
>
> The name could mention that we are cloning. And maybe you could do the work in the constructor, and just have accessors for the finished products, such as `_orig_to_new`.

Suggestion for better name `CloneDataNodeGraph`. Do you assert that only data nodes are cloned, and no CFG nodes?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18080#discussion_r1509050141


More information about the hotspot-compiler-dev mailing list