SPRUI04F july 2015 – april 2023
When a loop is software pipelined, the comment block preceding the loop provides the following information:
This information shows up in the comment block as follows:
;*Minimum required memory pad : 5 bytes
;*Minimum threshold value : --speculate_loads=7
;*
;*For further improvement on this loop, try option --speculate_loads=14
For safety, the example loop requires that array data referenced within this loop be preceded and followed by a pad of at least 5 bytes. This pad can consist of other program data. The pad will not be modified. In many cases, the threshold value (namely, the minimum value of the argument to --speculate_loads that is needed to achieve a particular schedule and level of collapsing) is the same as the pad. However, when it is not, the comment block will also include the minimum threshold value. In the case of this loop, the threshold value must be at least 7 to achieve this level of collapsing.
The compiler and linker can provide automatic load speculation via the auto argument to the --speculate_loads option (i.e. --speculate_loads=auto or -mh=auto). Use of the auto argument makes it easier to use and benefit from speculative load optimizations. This option can generate speculative loads of up to 256 bytes beyond memory that the compiler can prove to be allocated.
In addition, the compiler communicates information to the linker to help automatically ensure the required pre- and post-padding:
However, you can also specify the speculative loads threshold explicitly via the --speculate_loads=n option, where n is at least the minimum required pad (as explained earlier), but you also need to consider whether a larger threshold value would facilitate additional collapsing. This information is also provided, if applicable. For example, in the above comment block, a threshold value of 14 might facilitate further collapsing. If you choose the auto argument to --speculate_loads, the compiler will consider the larger threshold value automatically.