Front-end optimization, Avoid excessive loop unrolling, Front-end optimization -48 – Intel ARCHITECTURE IA-32 User Manual

Page 394: Avoid excessive loop unrolling -48

Advertising
background image

IA-32 Intel® Architecture Optimization

7-48

Front-end Optimization

In the Intel NetBurst microarchitecture family of processors, the
instructions are decoded into micro-ops

(μops) and sequences of μops

(called traces) are stored in the Execution Trace Cache. The Trace
Cache is the primary sub-system in the front end of the processor that
delivers

μop traces to the execution engine. Optimization guidelines for

front-end operation in single-threaded applications are discussed in
Chapter 2.

For dual-core processors where the second-level unified cache (for data
and code) is duplicated for each core (e.g., Pentium Processor Extreme
Edition, Pentium D processor), there are no special considerations for
front-end optimization on behalf of two processor cores in a physical
processor.

For dual-core processors where the second-level unified cache is shared
by two processor cores (e.g. Intel Core Duo processor), multi-threaded
software should consider the increase in code working set due to two
threads fetching code from the unified cache as part of front-end and
cache optimization.

This next two sub-sections discuss guidelines for optimizing the
operation of the Execution Trace Cache on IA-32 processors supporting
Hyper-Threading Technology.

Avoid Excessive Loop Unrolling

Unrolling loops can reduce the number of branches and improve the
branch predictability of application code. Loop unrolling is discussed in
detail in Chapter 2. Loop unrolling must be used judiciously. Be sure to
consider the benefit of improved branch predictability and the cost of
increased code size relative to the Trace Cache.

User/Source Coding Rule 37. (M impact, L generality) Avoid excessive loop
unrolling to ensure the Trace cache is operating efficiently.

Advertising