Understanding Feedback
1-10
-
Maximum Trip Count Factor. The maximum number that will divide
evenly into the trip count. Even though the exact value of the trip count is
not deterministic, it may be known that the value is a multiple of 2, 4, etc...,
which allows more agressive packed data and unrolling optimization.
The compiler tries to identify what the loop counter (named trip counter be-
cause of the number of trips through a loop) is and any information about the
loop counter such as minimum value (known minimum trip count), and wheth-
er it is a multiple of something (has a known maximum trip count factor).
If factor information is known about a loop counter, the compiler can be more
aggressive with performing packed data processing and loop unrolling opti-
mizations. For example, if the exact value of a loop counter is not known but
it is known that the value is a multiple of some number, the compiler may be
able to unroll the loop to improve performance.
There are several conditions that must be met before software pipelining is al-
lowed, or legal, from the compiler’s point of view. These conditions are:
-
It cannot have too many instructions in the loop. Loops that are too big,
typically require more registers than are available and require a longer
compilation time.
-
It cannot call another function from within the loop unless the called func-
tion is inlined. Any break in control flow makes it impossible to software
pipeline as multiple iterations are executing in parallel.
If any of the conditions for software pipelining are not met, qualification of the
pipeline will halt and a disqualification messages will appear. For more infor-
mation about what disqualifies a loop from being software-pipelined, see sec-
tion 3.4.3.6, on page 3-49.