29.01.2015 Views

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

508 Chapter 36<br />

parameter computation (in b5) is necessary. If, however, it is reached through<br />

path I, we need to compute the value of the actual parameter. Consequently,<br />

we conservatively <strong>de</strong>termine that EVAL(b5, x) is true; that is, the value of the<br />

actual parameter should be computed be<strong>for</strong>e the <strong>for</strong>mal parameter is accessed<br />

in b5.<br />

3.5. Additional optimization<br />

In data-flow analysis, we generally accept safe (or conservative) solutions<br />

which might, in some cases, lead to inefficiencies. In our case, the EVAL(…)<br />

computation algorithm presented in the previous subsection might re-compute<br />

the value of an actual parameter more than once when different execution<br />

paths merge at some CFG point. For example, consi<strong>de</strong>r the statement b5 in<br />

Figure 36-3(a). If, during execution, path II is taken, then the value of the<br />

actual parameter corresponding to x will be computed twice, wasting energy<br />

as well as execution cycles. In this work, we consi<strong>de</strong>r two different methods<br />

to handle this problem. In the first method, called block insertion, we create<br />

a new basic block and put the actual parameter computation co<strong>de</strong> there. Figure<br />

36-3(b) illustrates this solution, which creates a new block (shown sha<strong>de</strong>d)<br />

and inserts it along path I just be<strong>for</strong>e the statement b5 is reached. The actual<br />

parameter evaluation is per<strong>for</strong>med in this new basic block and the statement<br />

b5 does not per<strong>for</strong>m that evaluation. In this way, we guarantee that when b5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!