Pipelining for Itanium®-based Applications

The swp and noswp directives indicate preference for a loop to get software-pipelined or not. The swp directive does not help data dependence, but overrides heuristics based on profile counts or lop-sided control flow. The syntax for this directive is:

#pragma swp

#pragma noswp

Example of swp Directive

#pragma swp

for (i=0; i<m ; i++)

{

   if (a[i]==0)

   {

      b[i]=a[i]+1;

   }

   else

   {

      b[i]=a[i]*2;

   }

}

The software pipelining optimization triggered by the swp directive applies instruction scheduling to certain innermost loops, allowing instructions within a loop to be split into different stages, allowing increased instruction level parallelism. This can reduce the impact of long-latency operations, resulting in faster loop execution. Loops chosen for software pipelining are always innermost loops that do not contain procedure calls that are not inlined. Because the optimizer no longer considers fully unrolled loops as innermost loops, fully unrolling loops can allow an additional loop to become the innermost loop. You can request and view the optimization report to see whether software pipelining was applied (see Optimizer Report Generation).