- Loading...
Single entry loops
Irreducible loops
Clone loop head
Add regions and phis for loop head
Replace Region with Loop node
Beautify loops: split shared headers and merge multiple entry and back branch paths
IdealLoopTree structures describe loops tree
Dominators for control graph
Initial nodes assignment to loops (build_loop_early)
...
Find best nodes placement (build_loop_late)
Local subgraph transformations to simplify graph
Range checks and NULL checks moved outside loop if possible
Pattern match array initialization loop and replace it with call to assembler stub
Replace array initialization, copy and arithmetic with vector operations in unrolled loops
For each optimization below policy method is called to determine which optimization could be done for this loop
...
Main loop unrolling (with maximum 16 unrolls)
For array accesses range check is generated in compiled code:
...
If (index * SCALE + Offset < Range) {
The general idea is to insert a predicate on the entry path to a loop, and raise a uncommon trap if the check of the condition fails. The condition checks are promoted from inside the loop body, and thus the checks inside the loop could be eliminated. Currently, loop predication optimization has been applied to remove array range check and loop invariant checks (such as null checks).
...
Similar to array range check elimination loop predication is used to move a loop invariant check outside the loop directly.
Existing optimizations that perform elimination of checks inside the loops are iteration range splitting based. The loop is peeled to form pre-, main- and post-loops. The loop bounds are adjusted in the ways that checks in the main-loop could be safely removed.
...