RFR: 8343148: C2: Refactor uses of "PhaseValue::*con*() + PhaseIdealLoop::set_ctrl()" into separate method

Christian Hagedorn chagedorn at openjdk.org
Tue Nov 5 13:18:42 UTC 2024


On Fri, 1 Nov 2024 16:04:38 GMT, theoweidmannoracle <duke at openjdk.org> wrote:

> This patch introduces the methods `PhaseIdealLoop::intcon` and `PhaseIdealLoop::longcon` which are wrappers for:
> 
> 
> ConINode* node = _igvn.intcon(i);
> set_ctrl(node, C->root());
> 
> 
> and
> 
> 
> ConLNode* node = _igvn.longcon(i);
> set_ctrl(node, C->root());
> 
> 
> Occurrences of this pattern in loopnode.cpp were replaced with the appropriate call to the new methods.

While at it, we could extend this to the other constant creation methods `zerocon`, `makecon`, and `integercon` as well (`uncached_makecon` is only called by the other `*con*` methods - could be made `private` at some point). I suggest to update the RFE title accordingly since it only mentions `intcon` now. Maybe something like `PhaseValue::*con*() + ...`.

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

PR Comment: https://git.openjdk.org/jdk/pull/21836#issuecomment-2453927465


More information about the hotspot-compiler-dev mailing list