Java Reference
In-Depth Information
55. Figure 14.65 computes the location of
-functions one variable at a time.
Before the algorithmmoves fromone variable to the next, the flags hasPhi
and processed are reset to false .
Devise a more e
φ
cient algorithm that does not require resetting the flags
between variables. Hint: you can change the type of hasPhi and processed
from Booleanto integer.
56. SSA form requires that a definition of a name completely define that
name. Array assignments typicallymodify part, but not all, of the named
array. For example, assignment to A [ i ] leaves all elements of A other than
A [ i ] unchanged.
Develop an approach for translating array assignments and references
into SSA form, so that each assignment to an array does completely define
the named array.
57. SSA form requires that each definition site for a name be explicitly rep-
resented in a program. Consider a call to
foo
( v )where
foo
may, or
may not, assign v . For example, the only assignment to v in
foo
may be
programmed to occur only if v =
0.
Develop an approach for translating method calls into SSA form, so that
each call that may modify a given variable v surely does so every time
the method is called. Hint: if a method does not assign its own value to
v , then what value should v have on return from that method?
58. A reference r is said to may alias aname n if a load or store of r can be a
load or store of n . This information is needed by Exercise 59 to determine
the program names that may be a
ected by a given reference.
The set of all names a given reference may alias is called that reference's
may alias set. Investigate how may alias sets can be computed using
data flow analysis techniques. Compare the techniques you discover by
their cost and accuracy. What are the consequences of over- or under-
determining the correct may-alias sets for a reference?
ff
 
Search WWH ::




Custom Search