Here's another example...
More on Branch Predication and Control Speculation
if a[i].ptr != 0
   b[i] = a[i].l;
else
   b[i] = a[i].r;
i = i + 1;
The above code segment is sectioned into four basic blocks in most traditional architectures.
 
 
Rather than use four blocks for execution, the IA-64 organizes the code as such...
The processor will begin to execute both the <p1> and <p2> pathes and when the branch has been determined, one path will be killed.  For control speculation, the following code would be be organized as such:
This unique method of scheduling allows the memory latency to be hidden behind the computation of the if statement.

  Back to the previous page.