If a pointer or array expression, such as a[i ] or *p is assigned and then used, without the possibility of being changed in the interim, we can take advantage of the situation to simplify the DAG....


If a pointer or array expression, such as a[i ] or *p is assigned and then used, without the possibility of being changed in the interim, we can take advantage of the situation to simplify the DAG. For example, in the code of Exercise 8.5.6, since p is not assigned between the second and fourth statements, the statement e = *p can be replaced by e = c, regardless of what p points to. Revise the DAG-construction algorithm to take advantage of such situations, and apply your algorithm to the code of Example 8.5.6.


Example 8.5.6


Construct the DAG for the basic block


a[i ] = b


*p = c


d = a[j ] e = *p


*p = a[i ]


on the assumption that


a) p can point anywhere.

b) p can point only to b or d



May 22, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here