|
FAUST compiler
0.9.9.6b8
|
#include <loop.hh>

Public Member Functions | |
| Loop (Tree recsymbol, Loop *encl, const string &size) | |
| create a recursive loop More... | |
| Loop (Loop *encl, const string &size) | |
| create a non recursive loop More... | |
| bool | isEmpty () |
| true when the loop doesn't contain any line of code More... | |
| bool | hasRecDependencyIn (Tree S) |
| returns true is this loop or its ancestors define a symbol in S More... | |
| void | addPreCode (const string &str) |
| add a line of C++ code pre code More... | |
| void | addExecCode (const string &str) |
| add a line of C++ code More... | |
| void | addPostCode (const string &str) |
| add a line of C++ post code More... | |
| void | println (int n, ostream &fout) |
| print the loop More... | |
| void | printParLoopln (int n, ostream &fout) |
| print the loop with a #pragma omp loop More... | |
| void | printoneln (int n, ostream &fout) |
| print the loop in scalar mode More... | |
| void | absorb (Loop *l) |
| absorb a loop inside this one More... | |
| void | concat (Loop *l) |
Public Attributes | |
| const bool | fIsRecursive |
| recursive loops can't be SIMDed More... | |
| Tree | fRecSymbolSet |
| recursive loops define a set of recursive symbol More... | |
| Loop *const | fEnclosingLoop |
| Loop from which this one originated. More... | |
| const string | fSize |
| number of iterations of the loop More... | |
| set< Loop * > | fBackwardLoopDependencies |
| Loops that must be computed before this one. More... | |
| set< Loop * > | fForwardLoopDependencies |
| Loops that will be computed after this one. More... | |
| list< string > | fPreCode |
| code to execute at the begin of the loop More... | |
| list< string > | fExecCode |
| code to execute in the loop More... | |
| list< string > | fPostCode |
| code to execute at the end of the loop More... | |
| int | fOrder |
| used during topological sort More... | |
| int | fIndex |
| used during scheduler mode code generation More... | |
| int | fUseCount |
| how many loops depend on this one More... | |
| list< Loop * > | fExtraLoops |
| extra loops that where in sequences More... | |
| int | fPrinted |
| true when loop has been printed (to track multi-print errors) More... | |
create a recursive loop
Create a recursive loop.
| recsymbol | the recursive symbol defined in this loop |
| encl | the enclosing loop |
| size | the number of iterations of the loop |
Definition at line 41 of file loop.cpp.
| Loop::Loop | ( | Loop * | encl, |
| const string & | size | ||
| ) |
create a non recursive loop
Create a non recursive loop.
| encl | the enclosing loop |
| size | the number of iterations of the loop |
Definition at line 51 of file loop.cpp.
| void Loop::absorb | ( | Loop * | l | ) |
absorb a loop inside this one
Absorb a loop by copying its recursive dependencies, its loop dependencies and its lines of exec and post exec code.
| l | the Loop to be absorbed |
Definition at line 113 of file loop.cpp.
References fBackwardLoopDependencies, fExecCode, fPostCode, fPreCode, fRecSymbolSet, fSize, and setUnion().
Referenced by Klass::closeLoop().


| void Loop::addExecCode | ( | const string & | str | ) |
| void Loop::addPostCode | ( | const string & | str | ) |
add a line of C++ post code
Add a line of post exec code (end of the loop)
Definition at line 101 of file loop.cpp.
References fPostCode.
| void Loop::addPreCode | ( | const string & | str | ) |
add a line of C++ code pre code
Add a line of pre code (begin of the loop)
Definition at line 82 of file loop.cpp.
References fPreCode.
| void Loop::concat | ( | Loop * | l | ) |
Definition at line 237 of file loop.cpp.
References fBackwardLoopDependencies, fExtraLoops, and fUseCount.
Referenced by groupSeqLoops().

| bool Loop::hasRecDependencyIn | ( | Tree | S | ) |
returns true is this loop or its ancestors define a symbol in S
A loop with recursive dependencies can't be run alone.
It must be included into another loop. returns true is this loop has recursive dependencies and must be included in an enclosing loop
Definition at line 63 of file loop.cpp.
References fEnclosingLoop, fRecSymbolSet, isNil(), and setIntersection().
Referenced by Klass::closeLoop(), and VectorCompiler::generateLoopCode().


| bool Loop::isEmpty | ( | ) |
true when the loop doesn't contain any line of code
Test if a loop is empty that is if it contains no lines of code).
Definition at line 74 of file loop.cpp.
References fExecCode, fExtraLoops, fPostCode, and fPreCode.
Referenced by Klass::closeLoop().

| void Loop::println | ( | int | n, |
| ostream & | fout | ||
| ) |
print the loop
Print a loop (unless it is empty)
| n | number of tabs of indentation |
| fout | output stream |
Definition at line 134 of file loop.cpp.
References fExecCode, fExtraLoops, fPostCode, fPreCode, fSize, printlines(), and tab().
Referenced by Klass::printLoopDeepFirst().


| void Loop::printoneln | ( | int | n, |
| ostream & | fout | ||
| ) |
print the loop in scalar mode
Print a single loop (unless it is empty)
| n | number of tabs of indentation |
| fout | output stream |
Definition at line 214 of file loop.cpp.
References fExecCode, fPostCode, fPreCode, fSize, printlines(), and tab().
Referenced by Klass::printLoopGraphScalar().


| void Loop::printParLoopln | ( | int | n, |
| ostream & | fout | ||
| ) |
print the loop with a #pragma omp loop
Print a parallel loop (unless it is empty).
Should be called only for loop without pre and post processing
| n | number of tabs of indentation |
| fout | output stream |
Definition at line 172 of file loop.cpp.
References fExecCode, fExtraLoops, fPostCode, fPreCode, fSize, printlines(), and tab().

| set<Loop*> Loop::fBackwardLoopDependencies |
Loops that must be computed before this one.
Definition at line 59 of file loop.hh.
Referenced by absorb(), Klass::closeLoop(), computeUseCount(), concat(), VectorCompiler::CS(), groupSeqLoops(), Klass::printLoopDeepFirst(), and resetOrder().
| Loop* const Loop::fEnclosingLoop |
Loop from which this one originated.
Definition at line 56 of file loop.hh.
Referenced by Klass::closeLoop(), and hasRecDependencyIn().
| list<string> Loop::fExecCode |
code to execute in the loop
Definition at line 62 of file loop.hh.
Referenced by absorb(), addExecCode(), isEmpty(), println(), printoneln(), and printParLoopln().
| list<Loop*> Loop::fExtraLoops |
| set<Loop*> Loop::fForwardLoopDependencies |
| int Loop::fIndex |
used during scheduler mode code generation
Definition at line 66 of file loop.hh.
Referenced by Klass::buildTasksList(), and Klass::printOneLoopScheduler().
| const bool Loop::fIsRecursive |
| int Loop::fOrder |
used during topological sort
Definition at line 65 of file loop.hh.
Referenced by Klass::printLoopDeepFirst(), resetOrder(), and setOrder().
| list<string> Loop::fPostCode |
code to execute at the end of the loop
Definition at line 63 of file loop.hh.
Referenced by absorb(), addPostCode(), isEmpty(), println(), printoneln(), and printParLoopln().
| list<string> Loop::fPreCode |
code to execute at the begin of the loop
Definition at line 61 of file loop.hh.
Referenced by absorb(), addPreCode(), isEmpty(), println(), printoneln(), and printParLoopln().
| int Loop::fPrinted |
| Tree Loop::fRecSymbolSet |
recursive loops define a set of recursive symbol
Definition at line 55 of file loop.hh.
Referenced by absorb(), Klass::closeLoop(), and hasRecDependencyIn().
| const string Loop::fSize |
number of iterations of the loop
Definition at line 57 of file loop.hh.
Referenced by absorb(), println(), printoneln(), and printParLoopln().
| int Loop::fUseCount |
how many loops depend on this one
Definition at line 68 of file loop.hh.
Referenced by computeUseCount(), concat(), and groupSeqLoops().
1.8.7