On the assumption that n will always be even unroll inner


Repeat Exercise 10.3 on the assumption that a is allocated dynamic storage, with ptr a pointer to the first word of a .
Exercise 10.3 The program of Fig. 10.73 counts the primes from 2 to n using the sieve method on a suitably large array.

319_c9db8bc2-394a-4c23-b758-04cce39a25b3.png

a) Translate the program of Fig. to.73 into three-address statements assuming a is allocated static storage.

b) Generate target-machine code from the three-address statements.

c) Construct a flow graph from the three-address statements.

d) Show (he dominator tree for the flow graph in (a).

e) For the flow graph in (c), indicate the back edges and their natural loops.

f) Move the invariant computations QuI of loops using Algorithm 10.7.

g) Eliminate induction variables wherever possible.

h) Propagate out copy statements wherever possible.

i) Is loop jamming possible? If so, do it.

j) On the assumption that n will always be even, unroll inner loops once each. What new optimizations are now possible?

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: On the assumption that n will always be even unroll inner
Reference No:- TGS01487307

Expected delivery within 24 Hours