United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7008866 Missing loop predicate for loop with multiple entries
JDK-7008866 : Missing loop predicate for loop with multiple entries

Details
Type:
Enhancement
Submit Date:
2010-12-23
Status:
Closed
Updated Date:
2014-04-02
Project Name:
JDK
Resolved Date:
2011-04-25
Component:
hotspot
OS:
solaris_10
Sub-Component:
compiler
CPU:
sparc
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs21 (b06)

Related Reports
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

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-comp/hotspot/rev/9dc311b8473e
                                     
2011-03-21
EVALUATION

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

http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/9dc311b8473e
                                     
2011-03-25
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
                                     
2011-03-22



Hardware and Software, Engineered to Work Together