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

Yi Yang yyang at openjdk.java.net
Wed May 19 02:39:05 UTC 2021


> 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()

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4079/files
  - new: https://git.openjdk.java.net/jdk/pull/4079/files/eb2e1370..55712395

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4079&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4079&range=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 2 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4079.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4079/head:pull/4079

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


More information about the hotspot-compiler-dev mailing list