HOME       UP       PREV       NEXT (NOTITLE)  

Array Hazards in RTL Continued

Expanding blocking assignments can lead to name alias hazards:
Suppose we know nothing about xx and yy, then consider:
   if (g) Foo[xx] = e1;
   r2 = Foo[yy];
To avoid name alias problems, this must be compiled to non-blocking pure RTL as:
   Foo[xx] <= (g) ? e1: Foo[xx];
   r2 <= (xx==yy) ? ((g) ? e1:  Foo[xx]): Foo[yy];
Quite commonly we do know something about the subscript expressions.

If they are compile-time constants, we can decidedly check the equality at compile time.

Suppose that at ... or elsewhere beforehand we had the line `yy = xx+1;' or equivalent knowledge? Then with sufficient rules we can realise at compile time they will never alias. However, no set of rules will be complete (decidability).

35: (C) 2008-11, DJ Greaves, University of Cambridge, Computer Laboratory.