Consider a basic block:
x:= a[i]; a[j]:= y; z:= a[j]
optimized by removing common sub expression a[i] as follows:
x:= a[i]; z:= x; a[j]:= y.
Which of the following is true?
- Both are equivalent.
- The values computed by both are exactly the same.
- Both give exactly the same values only if $i$ is not equal to $j$.
- They will be equivalent in concurrent programming languages with shared memory.
- None of the above.