• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. HotSpot
  4. Loop optimizations in Hotspot Server VM Compiler (C2)

Page History

Versions Compared

Old Version 1

changes.mady.by.user Vladimir Kozlov

Saved on Aug 15, 2014

compared with

New Version 2

changes.mady.by.user Vladimir Kozlov

Saved on Aug 15, 2014

  • Next Change: Difference between versions 2 and 3
  • View Page History

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Loop Optimizations in C2

Loop Identification

ciTypeFlow analysis

Single entry loops

Irreducible loops

Clone loop head

Parse phase

Add regions and phis for loop head

IdealLoop phase

Replace Region with Loop node

Beautify loops: split shared headers and merge multiple entry and back branch paths

Loop Construction

Building side tables for ideal graph

IdealLoopTree structures describe loops tree

Dominators for control graph

Data nodes placement

Initial nodes assignment to loops (build_loop_early)

...

Find best nodes placement (build_loop_late)

Loop Optimizations

Split-if and split-through-phi

Local subgraph transformations to simplify graph

Loop predication

Range checks and NULL checks moved outside loop if possible

Array filling

Pattern match array initialization loop and replace it with call to assembler stub

Vectorization

Replace array initialization, copy and arithmetic with vector operations in unrolled loops

Iteration splitting for inner 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)

Range Check Elimination

For array accesses range check is generated in compiled code:

...

  If (index * SCALE + Offset < Range) {

Loop Predication

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.

Loop Predication Advantages

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.

...

Overview
Content Tools
ThemeBuilder

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.23
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 225, "requestCorrelationId": "43ed38e67d0daa1c"}