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

    Loading...
  1. Dashboard
  2. Undefined Space
  3. HotSpot
  4. LoopPredication

Page History

Versions Compared

Old Version 25

changes.mady.by.user Changpeng Fang

Saved on Jan 20, 2010

compared with

New Version 26

changes.mady.by.user Changpeng Fang

Saved on Jan 20, 2010

  • Previous Change: Difference between versions 24 and 25
  • Next Change: Difference between versions 26 and 27
  • View Page History

Key

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

...

original loop

for (int i = init,  i < limit;  i += stride) {  // loop with array range check
    ...
    if (scale*i + offset < a.length) {  // array range check
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="284dd9ed58c69a7b-4ddd3b12-46f34ff7-9fa3a8ba-f451b277d839c81d50fec11a"><ac:plain-text-body><![CDATA[        ... a[scale*i+offset] ...
]]></ac:plain-text-body></ac:structured-macro>
    } else raise_uncommon_trap();
    ...
}

after loop predication

if ( scale * imax + offset < a.length ) {  // loop predicate. imax is the maximum value of i where init <= i < limit
    for (int i = init,  i < limit;  i += stride) {  // loop without array range check
         ...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="7b5ee4510a3f9db3-4f1b1963-47bf43ee-a64596e3-8c045f05310e9e517293c7ae"><ac:plain-text-body><![CDATA[         ... a[scale*i+offset] ...
]]></ac:plain-text-body></ac:structured-macro>
         ...
    }
} else raise_uncommon_trap();

...

Existing optimizations that perform elimination of checks inside the loops are iteration range splitting based.  The loop is peeled

...

The major disadvantage of iteration range splitting based check elimination is the dramatic increase in code size due to the copies

of the loop. In addition, the checks in the pre- and post-loops are not eliminated, and thus the performance gain is limited if when the iteration

space is small.

Compared with the iteration range splitting based check elimination, loop predication has the following advantages:

...

4. (for future work) Loop predication provides a unified interface that can be implemented (extended) to replace the existing iteration range

    splitting based check eliminations (loop peeling, partial peeling, range check elimination)

...

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": 154, "requestCorrelationId": "c831330225797972"}