JDK-7008866 : Missing loop predicate for loop with multiple entries
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2010-12-23
  • Updated: 2022-10-03
  • Resolved: 2011-04-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u45Fixed 7Fixed hs21Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Consider next case:

if (a) {
  ...
}
for (; i<l;i++) {}

The loop has 2 entry paths. Loop predicates are generated for each path and they have different code execution state. Later in IdealLoopTree::beautify_loops() a merge region will be created for these fall in paths separating predicates from the loop. As result those predicates will be removed.

Investigate possibility to add an empty block before loop head block in CI flow to merge fall in paths only (not back branches).

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/9dc311b8473e
25-03-2011

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/9dc311b8473e
25-03-2011

PUBLIC COMMENTS Synopsis is a little misleading since I don't mean irreducible loop entries (new code has a check to not add predicates to irreducible loops). I mean there could be several entry and backbranch paths to loop head. Currently loop predicates are generated when each backbranch path is parsed. Later in IdealLoopTree::beautify_loops() a merge region will be created if there are several entry paths separating predicates from the loop. As result those predicates will be removed. Add predicates when loop head bytecode is parsed instead of when back branch bytecode is parsed. All fall in paths will be merged already at this point and for back branches a new merge region is created. Add missing loop predicate when there are back branches to the method entry first bytecode. Add missing predicates for loops generated in Ideal graph, for example, for intrinsics. Rearrange some code to help next loop optimization changes. For example, in PhaseIdealLoop::is_counted_loop() move bailout checks before new ideal nodes are generated. Add new counted loop verification code. Perform local Ideal transformation for parallel induction variables replacement since in most cases they use the same stride (ratio == 1). In PhaseIdealLoop::split_thru_phi() don't move split node (or existing node returned by Identity()) inside a loop if all its uses are outside of this loop. Otherwise the node will be cloned for each outside use and this will mess up an external canonical counted loop if the node is loop's increment, for example. Preserve unswitch count when partial peel is executed and when a loop is converted to counted. Add debug flag TraceLoopOpts to show executed loop optimizations and also print whole loop tree at the beginning of each iteration of loop optimizations: PartialPeel Loop: N22966/N22965
22-03-2011

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/9dc311b8473e
21-03-2011