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

Yi Yang yyang at openjdk.java.net
Tue May 18 03:24:58 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)

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

Commit messages:
 - loop unswitching opt

Changes: https://git.openjdk.java.net/jdk/pull/4079/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4079&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8267151
  Stats: 28 lines in 2 files changed: 3 ins; 14 del; 11 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