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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Control Flow Driven Splitting of Loop Nests 219<br />

optimization problems. They have been successfully utilized in the domains<br />

of co<strong>de</strong> generation <strong>for</strong> irregular architectures [13, 16] or VLSI CAD [4].<br />

3. ANALYSIS AND OPTIMIZATION ALGORITHM<br />

This section presents the techniques required <strong>for</strong> loop nest splitting. The<br />

optimization consists of four sequentially executed tasks. In the beginning, all<br />

conditions in a loop nest are analyzed separately without consi<strong>de</strong>ring any<br />

inter<strong>de</strong>pen<strong>de</strong>ncies in-between. First, it is <strong>de</strong>tected if conditions have any influence<br />

on the control flow of a loop nest. If not, such redundant conditions are<br />

removed from the co<strong>de</strong>. For every single remaining condition, an optimized<br />

geometric mo<strong>de</strong>l is created in the second step. Third, these geometric mo<strong>de</strong>ls<br />

are combined to a global search space representing all conditions in all ifstatements<br />

of the loop nest simultaneously. To obtain an optimized result <strong>for</strong><br />

a loop nest, this global search space is explored in a fourth step. Be<strong>for</strong>e going<br />

into <strong>de</strong>tails (cf. also [5, 6]), some preliminaries are required.<br />

Definition 1:<br />

1.<br />

2.<br />

Let be a loop nest of <strong>de</strong>pth N, where <strong>de</strong>notes a single<br />

loop.<br />

Let and be the in<strong>de</strong>x variable, lower bound and upper bound of<br />

loop with<br />

The optimization goal <strong>for</strong> loop nest splitting is to <strong>de</strong>termine values<br />

<strong>for</strong> every loop with<br />

and<br />

all loop-variant if-statements in are satisfied <strong>for</strong> all values of the in<strong>de</strong>x<br />

variables with<br />

loop nest splitting by all values and leads to the minimization of<br />

if-statement execution.<br />

The values and are used <strong>for</strong> generating the splitting if-statement.<br />

The techniques <strong>de</strong>scribed in the following require that some preconditions are<br />

met:<br />

1.<br />

2.<br />

3.<br />

All loop bounds and are constants.<br />

If-statements have the <strong>for</strong>mat if<br />

with loop-invariant<br />

conditions that are combined with logical operators<br />

Loop-variant conditions are affine expressions of and can thus have<br />

the <strong>for</strong>mat<br />

and<br />

Assumption 2 is due to the current state of implementation of our tools.<br />

By applying <strong>de</strong> Morgan’s rule on<br />

and inverting the comparators

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

Saved successfully!

Ooh no, something went wrong!