08.11.2014 Views

COMPILER TECHNIQUES FOR MATLAB PROGRAMS ... - CiteSeerX

COMPILER TECHNIQUES FOR MATLAB PROGRAMS ... - CiteSeerX

COMPILER TECHNIQUES FOR MATLAB PROGRAMS ... - CiteSeerX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Built-in<br />

R<br />

R<br />

W<br />

Function<br />

W<br />

Multiple<br />

R/W<br />

Start<br />

1<br />

2<br />

3<br />

M-File<br />

R<br />

W<br />

Variable<br />

R/W<br />

R/W<br />

Empty<br />

Figure 4.3: State diagram for dierentiation between functions and variables.<br />

4.2 Static Single Assignment<br />

4.2.1 Extensions to the Symbol Table for the SSA Representation<br />

To support the SSA representation, our symbol table is divided in two main parts: the entry<br />

list and for each entry, a list containing all variable instances. As an example, consider again<br />

the SSA representation of the program to compute the average of a vector, presented in<br />

Figure 3.3(b). The data structure for the symbol table corresponding to this program is<br />

outlined in Figure 4.4.<br />

Each nodeintheentry list contains the information that is shared by all instances<br />

of the corresponding variable, such as loaded name and program name 1 ,aswell as global<br />

information used by the symbol table manager, suchasthenumber of instances and a pointer<br />

to the start of the corresponding variable's instance list. Information about built-ins and<br />

M-les are also stored in the symbol table. Therefore a eld kind is used to indicate if the<br />

entry is a variable, built-in, M-le, or multiple (for identier in the state Multiple described<br />

1 The original <strong>MATLAB</strong> name must be saved for the load function. The loaded name may be dierent<br />

than the program name due to renaming performed by the inliner.<br />

35

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

Saved successfully!

Ooh no, something went wrong!