RFR: 8373420: C2: Add true/false_proj*() methods for IfNode as a replacement for proj_out*(true/false)
Damon Fenacci
dfenacci at openjdk.org
Wed Dec 10 15:56:23 UTC 2025
On Wed, 10 Dec 2025 13:13:44 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
> There are a lot of places in the code where we call `proj_out*(true/false)` on an `IfNode`. In some cases, we then cast the returned `ProjNode` back to `IfProjNode` or `IfTrueNode/IfFalseNode`. I often visit such code and now decided to clean this up.
>
> The patch proposes new `IfNode::true/false_proj*()` methods that return `IfTrueNode/IfFalseNode` directly. I walked through all `proj_out*()` calls and replaced those that used a direct `true/false` or `1/0` as argument.
>
> There are still more things to clean up in this area, for example, when we return `ProjNode` even though it should be an `IfProjNode` which requires more casting. But let's do that step by step in follow-up clean ups.
>
> Thanks,
> Christian
Nice cleanup. Thanks @chhagedorn. Looks good to me.
-------------
Marked as reviewed by dfenacci (Committer).
PR Review: https://git.openjdk.org/jdk/pull/28745#pullrequestreview-3563263362
More information about the hotspot-compiler-dev
mailing list