Expanding blocking assignments can lead to name alias hazards:
Suppose we know nothing about xx and yy, then consider:
begin ... if (g) Foo[xx] = e1; r2 = Foo[yy]; | To avoid name alias problems, this must be compiled to non-blocking pure RTL as:
begin ... Foo[xx] <= (g) ? e1: Foo[xx]; r2 <= (xx==yy) ? ((g) ? e1: Foo[xx]): Foo[yy]; |
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).
And commonly they are a linear function of a loop variable of an enclosing loop (an induction expression) and, after strength reduction, the xx+k pattern is readily manifest.
41: (C) 2012-17, DJ Greaves, University of Cambridge, Computer Laboratory. | ![]() |