Intel 64 and IA-32 Architectures Software Developers Manual Volume 3B, System Programming Guide Part 2

Table Of Contents
Vol. 3 A-119
PERFORMANCE-MONITORING EVENTS
To determine the branch misprediction ratio,
divide the BR_INST_RETIRED.MISPRED event
count by the number of
BR_INST_RETIRED.ANY event count. To
determine the number of mispredicted
branches per instruction, divide the number
of mispredicted branches by the
INST_RETIRED.ANY event count. To measure
the impact of the branch mispredictions use
the event
RESOURCE_STALLS.BR_MISS_CLEAR.
Tips
- See the optimization guide for tips on
reducing branch mispredictions.
- PGO's purpose is to have straight line code
for the most frequent execution paths,
reducing branches taken and increasing the
"basic block" size, possibly also reducing the
code footprint or working-set.
C4H 0CH BR_INST_RETIR
ED.TAKEN
Retired taken
branch
instructions
This event counts the number of branches
retired that were taken.
C4H 0FH BR_INST_RETIR
ED.ANY1
Retired branch
instructions
This event counts the number of branch
instructions retired that were mispredicted.
This event is a duplicate of
BR_INST_RETIRED.MISPRED.
C5H 00H BR_INST_RETIR
ED.MISPRED
Retired
mispredicted
branch
instructions
(precise event).
This event counts the number of retired
branch instructions that were mispredicted
by the processor. A branch misprediction
occurs when the processor predicts that the
branch would be taken, but it is not, or vice-
versa. Mispredicted branches degrade the
performance because the processor starts
executing instructions along a wrong path it
predicts. When the misprediction is
discovered, all the instructions executed in
the wrong path must be discarded, and the
processor must start again on the correct
path.
Table A-7. Non-Architectural Performance Events for Intel Atom Processors
Event
Num.
Umask
Value Event Name Definition Description and Comment