RFR: 8373420: C2: Add true/false_proj*() methods for IfNode as a replacement for proj_out*(true/false)
Christian Hagedorn
chagedorn at openjdk.org
Wed Dec 17 11:17:32 UTC 2025
On Mon, 15 Dec 2025 16:07:49 GMT, Emanuel Peter <epeter 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
>
> Marked as reviewed by epeter (Reviewer).
Thanks for your reviews @eme64, @rwestrel and @dafedafe!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28745#issuecomment-3664876821
More information about the hotspot-compiler-dev
mailing list