User Guide
|
Helper visitor to replace index of array variable with integer. More...
Helper visitor to replace index of array variable with integer.
When loop is unrolled, the index variable like i
:
ca[i] <-> ca[i+1]
has type Name
in the AST. This needs to be replaced with Integer
for optimizations like constant folding. This pass look at name and binary expressions under index variables.
Definition at line 31 of file loop_unroll_visitor.cpp.
Private Attributes | |
std::string | index |
index variable name More... | |
int | value |
integer value of index variable More... | |
bool | under_indexed_name = false |
true if we are visiting index variable More... | |
|
inline |
Definition at line 43 of file loop_unroll_visitor.cpp.
|
inline |
if expression we are visiting is Name
then return new Integer
node
Definition at line 48 of file loop_unroll_visitor.cpp.
|
inlineoverridevirtual |
visit node of type ast::BinaryExpression
first recursively replaces children replace lhs & rhs if they have matching index variable
Implements nmodl::visitor::Visitor.
Definition at line 59 of file loop_unroll_visitor.cpp.
|
inlineoverridevirtual |
visit node of type ast::IndexedName
once all children are replaced, do the same for index
Implements nmodl::visitor::Visitor.
Definition at line 71 of file loop_unroll_visitor.cpp.
|
private |
index variable name
Definition at line 34 of file loop_unroll_visitor.cpp.
|
private |
true if we are visiting index variable
Definition at line 40 of file loop_unroll_visitor.cpp.
|
private |
integer value of index variable
Definition at line 37 of file loop_unroll_visitor.cpp.