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.

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

The optimization of the values is done by a genetic algorithm (GA)<br />

[2]. The chromosome length is set to the number of in<strong>de</strong>x variables<br />

<strong>de</strong>pends on: For every such variable a gene on the chromosome<br />

represents Using the values of the fittest individual, the<br />

optimized polytope is generated as the result of this phase:<br />

The fitness of an individual I is the higher, the fewer if-statements are<br />

executed when splitting using the values enco<strong>de</strong>d in I. Since only the<br />

fittest individuals are selected, the GA minimizes the execution of if-statements.<br />

Consequently, an individual implying that C is not satisfied has a very<br />

low fitness. For an individual I, the fitness function computes the number of<br />

executed if-statements There<strong>for</strong>e, the following values are required:<br />

Definition 3:<br />

1. The total iteration space (TS) of a loop nest<br />

executions of the body of loop<br />

is the total number of<br />

2.<br />

The constrained iteration space (CS) is the total iteration space reduced<br />

to the ranges represented by<br />

3.<br />

The innermost loop is the in<strong>de</strong>x of the loop where a loop nest splitting<br />

has to be done <strong>for</strong> a given set of values:<br />

The aggregate number of executed if -statements<br />

follows:<br />

is computed as<br />

(if-statements in the else-part of the splitting-if plus the splitting-if itself)<br />

(all iterations of<br />

minus the ones where the splitting-if evaluates to true)<br />

(splitting-if is evaluated as often as its then- and else-parts are executed)<br />

(all loop nest iterations where splitting-if is true divi<strong>de</strong>d by all loop iterations<br />

located in the then-part)

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

Saved successfully!

Ooh no, something went wrong!