RFR: 8327110: Refactor create_bool_from_template_assertion_predicate() to separate class and fix identical cloning cases used for Loop Unswitching and Split If [v2]
Christian Hagedorn
chagedorn at openjdk.org
Thu Mar 28 12:25:32 UTC 2024
On Wed, 27 Mar 2024 16:05:10 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> What scenario is there where we collect no nodes? Probably there is some, where we don't have to clone anything.. but it's a bit strange. Would be nice to have a quick comment here about that.
Sometimes, we want to assert that a node does not represent a Template Assertion Predicate anymore but is actually an initialized Assertion Predicate (without `OpaqueLoop*Nodes`). Example:
https://github.com/openjdk/jdk/blob/2af0312c958e693b1377f4c014ae8f84cabf6b83/src/hotspot/share/opto/loopTransform.cpp#L3044-L3047
Therefore, I'm planning to re-use this class to also verify the absence of `OpaqueLoop*Nodes` in a later PR.
> For simplicity, you could always call backtrack (it just does nothing anyway).
Then you can just make the assert a bit smarter:
assert(_collected_nodes.size() == 0 || _collected_nodes.member(start_node), "must find start node again when backtracking");
Good point, I will do that.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18293#discussion_r1542862135
More information about the hotspot-compiler-dev
mailing list