SPRUIV4D May 2020 – May 2024
The C7000 compiler goes through three basic stages when software pipelining a loop. The three stages are:
By the time the compiler tries to software pipeline an inner loop, the compiler may have applied certain transformations to the code in the loop, and also may have combined adjacent or nested loops.
Stage 1: Qualification
Several conditions must be met before software pipelining is allowed, or found to be legal, from the compiler’s point of view. Two of the most common conditions that cause software pipelining to fail are:
If any conditions for software pipelining are not met, qualification of the pipeline halts and a disqualification messages appears. See Section 5.4.1. for troubleshooting and Section 5.2.1 for information provided during this stage.
If all conditions for software pipelining are met, the compiler continues to Stage 2.
Stage 2: Collecting Loop and Dependency Information
The second stage of software pipelining involves collecting loop resource and dependency graph information. See Section 5.2.2 for information about output from this stage.
Stage 3: Software Pipelining Attempts
Once the compiler has qualified the loop for software pipelining, partitioned it, and analyzed the necessary loop carry and resource requirements, it can attempt software pipelining.
The compiler attempts to software
pipeline a loop starting at a certain initiation interval
(ii
). Each time a compiler software pipelining attempt at a
particular initiation interval fails, the ii
is increased, and
another software pipelining attempt is made. This can be seen in the Software
Pipeline Information comment block. This process continues until a software
pipelining attempt succeeds or ii
is equal to the length of a
scheduled loop with no software pipelining. If ii
reaches the
length of a scheduled loop with no software pipelining, attempts to software
pipeline stop and the compiler generates a non-software pipelined loop. See Section 5.2.3 for more about the
information provided during this stage.
If a software pipelining attempt is not successful, the compiler provides additional feedback to help explain why. See Section 5.4.2 for a list of the most common software pipeline failures and strategies for mitigation.
After a successful software pipeline schedule and register allocation is found at a particular initiation interval, more information about the loop is displayed. See Section 5.2.4, Section 5.2.5, Section 5.2.6, Section 5.2.7, and Section 5.2.8.