Flow Graph Illustrating Opportunities For Off-Path Predication - Intel ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3 Manual

Hide thumbs Also See for ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3:
Table of Contents

Advertisement

Figure 4-1.
If some of the instructions in block A or block B can be included in the main trace
without increasing its critical path, then techniques of upward code motion can be
applied to reduce the critical path through blocks A and B when they are taken. An
example of how to use predication to implement upward code motion is given in the
next section.
4.2.3.3
Upward Code Motion
When traditional control speculation is inadequate, it may still be possible to predicate
an instruction and move it up or down in the schedule to reduce dependency height.
This is possible because predicating an instruction replaces a control dependency with a
data dependency. If the data dependency is less constraining than the control
dependency, such a transformation may improve the instruction schedule.
Given the Itanium architecture-based assembly sequence below, the store instruction
cannot be moved above the enclosing conditional instruction because it could cause an
address fault or other exception, depending upon the branch direction:
(p1)
One reason why it might be desirable to move the store instruction up is to allow loads
below it to move up.
Note: Ambiguous stores are barriers beyond which normal loads cannot move. In this
case, moving the store also frees up an M-unit slot. To rewrite the code so that
the store comes before the branch, p2 has been assigned the complement of
p1:
(p2)
(p2)
(p1)
Since the store is now predicated, no faults or exceptions are possible when the branch
is taken, and memory state is only updated if and when the original home block of the
store is entered. Once the store is moved, it is also possible to move the load
instruction without having to use advanced or speculative loads (as long as r5 is not
live on the taken branch path).
Volume 1, Part 2: Predication, Control Flow, and Instruction Stream

Flow Graph Illustrating Opportunities for Off-path Predication

Block A
br.cond some_label
st4
[r34] = r23
ld4
r5 = [r56]
ld4
r6 = [r57]
st4
[r34] = r23
ld4
r5 = [r56]
br.cond some_label
ld4
r6 = [r57]
// Cycle 0
// Cycle 1
// Cycle 1
// Cycle 2:no cycle 1 M's
// Cycle 0
// Cycle 0
// Cycle 0
// Cycle 1
Block B
1:167

Advertisement

Table of Contents
loading

This manual is also suitable for:

Itanium architecture 2.3

Table of Contents