RFR: 8339733: C2: some nodes can have incorrect control after do_range_check() [v4]

Roland Westrelin roland at openjdk.org
Wed Sep 11 11:21:41 UTC 2024


> PhaseIdealLoop::do_range_check() sets the control of the new pre and
> main limits to be the entry control of the pre loop but it eliminates
> all conditions whose parameters are invariant in the main loop. Most
> of the time they are also invariant in the pre loop but that's not
> guaranteed. It does happen sometimes that those parameters are pinned
> in the pre loop. In that case, PhaseIdealLoop::do_range_check() sets
> wrong controls.
> 
> This doesn't cause any issue today AFAICT.
> 
> Also, this seems to be a typo in PhaseIdealLoop::insert_pre_post_loops():
> 
> 
> pre_head->in(0)
> 
> 
> is `pre_head`. I fixed that one too.

Roland Westrelin has updated the pull request incrementally with two additional commits since the last revision:

 - Update src/hotspot/share/opto/loopTransform.cpp
   
   Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
 - Update src/hotspot/share/opto/loopTransform.cpp
   
   Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20908/files
  - new: https://git.openjdk.org/jdk/pull/20908/files/03d80a49..2f4e0763

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20908&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20908&range=02-03

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

PR: https://git.openjdk.org/jdk/pull/20908


More information about the hotspot-compiler-dev mailing list