RFR: 8267151: C2: Don't create dummy Opaque1Node for outmost unswitched IfNode [v2]

Tobias Hartmann thartmann at openjdk.java.net
Wed May 19 08:12:42 UTC 2021


On Wed, 19 May 2021 02:39:05 GMT, Yi Yang <yyang at openjdk.org> wrote:

>> In create_slow_version_of_loop(), C2 creates the outmost unswitched IfNode(i.e. **if(xx)**{ for{} }else{ for{} }) with a dummy opaque bool node as its condition input.
>> 
>> https://github.com/openjdk/jdk/blob/cd1c17c0a6416a8d16cf2035f3e97dba95b6b8af/src/hotspot/share/opto/loopUnswitch.cpp#L265-L271
>> 
>> After that, it sets the _prob(missing _fcnt?) of the outmost unswitched IfNode in do_unswitching().
>> 
>> https://github.com/openjdk/jdk/blob/cd1c17c0a6416a8d16cf2035f3e97dba95b6b8af/src/hotspot/share/opto/loopUnswitch.cpp#L186-L191
>> 
>> I think we can merge these two steps into a single step, that is, create the outmost unswitched IfNode meanwhile setting its condition input, _prob and _fcnt w/ creating the dummy opaque bool node.
>> 
>> Testing:
>> - hotspot/jtreg/compiler(slowdebug)
>
> Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   unused head->is_CountedLoop()

Looks good to me.

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

Marked as reviewed by thartmann (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/4079


More information about the hotspot-compiler-dev mailing list