Technical data

#pragma Directives [3]
line option is specified. On UNICOS systems, the compiler may do additional
unrolling over the amount requested by the user.
In the following example, assume that the outer loop of the following nest will
be unrolled by two:
#pragma _CRI unroll 2
for (i = 0; i < 10; i++) {
for (j = 0; j < 100; j++) {
a[i][j] = b[i][j] + 1;
}
}
With outer loop unrolling, the compiler produces the following nest, in which the
two bodies of the inner loop are adjacent to each other:
for (i = 0; i < 10; i += 2) {
for (j = 0; j < 100; j++) {
a[i][j] = b[i][j] + 1;
}
for (j = 0; j < 100; j++) {
a[i+1][j] = b[i+1][j] + 1;
}
}
The compiler then jams,orfuses, the inner two loop bodies, producing the
following nest:
for (i = 0; i < 10; i += 2) {
for (j = 0; j < 100; j++) {
a[i][j] = b[i][j] + 1;
a[i+1][j] = b[i+1][j] + 1;
}
}
Outer loop unrolling is not always legal because the transformation can change
the semantics of the original program.
For example, unrolling the following loop nest on the outer loop would change
the program semantics because of the dependency between a[i][...] and
a[i+1][...]:
S217936 99