CIRCT 20.0.0git
|
An interface for conversion passes that lower Calyx programs. More...
#include <CalyxLoweringUtils.h>
Public Member Functions | |
CalyxLoweringState (mlir::ModuleOp module, StringRef topLevelFunction) | |
mlir::ModuleOp | getModule () |
Returns the current program. | |
StringRef | getTopLevelFunction () const |
Returns the name of the top-level function in the source program. | |
std::string | blockName (Block *b) |
Returns a meaningful name for a block within the program scope (removes the ^ prefix from block names). | |
template<typename T = calyx::ComponentLoweringStateInterface> | |
T * | getState (calyx::ComponentOp op) |
Returns the component lowering state associated with op . | |
template<typename ValueOrBlock > | |
std::string | irName (ValueOrBlock &v) |
Returns a meaningful name for a value within the program scope. | |
Private Attributes | |
StringRef | topLevelFunction |
The name of this top-level function. | |
mlir::ModuleOp DenseMap< Operation *, std::unique_ptr< ComponentLoweringStateInterface > > | componentStates |
The program associated with this state. | |
An interface for conversion passes that lower Calyx programs.
This handles state during the lowering of a Calyx program.
Definition at line 542 of file CalyxLoweringUtils.h.
|
explicit |
Definition at line 465 of file CalyxLoweringUtils.cpp.
std::string circt::calyx::CalyxLoweringState::blockName | ( | Block * | b | ) |
Returns a meaningful name for a block within the program scope (removes the ^ prefix from block names).
Definition at line 478 of file CalyxLoweringUtils.cpp.
References blockName(), and irName().
Referenced by blockName(), circt::pipelinetocalyx::BuildOpGroups::buildOp(), circt::scftocalyx::BuildOpGroups::buildOp(), and circt::calyx::BuildBasicBlockRegs::partiallyLowerFuncToComp().
mlir::ModuleOp circt::calyx::CalyxLoweringState::getModule | ( | ) |
Returns the current program.
Definition at line 469 of file CalyxLoweringUtils.cpp.
References assert().
|
inline |
Returns the component lowering state associated with op
.
If not found already found, a new mapping is added for this ComponentOp. Different conversions may have different derived classes of the interface, so we provided a template.
Definition at line 562 of file CalyxLoweringUtils.h.
References componentStates.
Referenced by circt::calyx::ConvertIndexTypes::FuncOpPartialLoweringPattern(), circt::calyx::RewriteMemoryAccesses::partiallyLower(), circt::calyx::FuncOpPartialLoweringPattern::partiallyLower(), circt::pipelinetocalyx::FuncOpConversion::partiallyLowerFuncToComp(), circt::scftocalyx::FuncOpConversion::partiallyLowerFuncToComp(), and circt::scftocalyx::BuildControl::scheduleBasicBlock().
StringRef circt::calyx::CalyxLoweringState::getTopLevelFunction | ( | ) | const |
Returns the name of the top-level function in the source program.
Definition at line 474 of file CalyxLoweringUtils.cpp.
References topLevelFunction.
Referenced by circt::scftocalyx::FuncOpConversion::partiallyLowerFuncToComp().
|
inline |
Returns a meaningful name for a value within the program scope.
Definition at line 577 of file CalyxLoweringUtils.h.
Referenced by blockName(), and circt::scftocalyx::BuildWhileGroups::partiallyLowerFuncToComp().
|
private |
The program associated with this state.
Mapping from ComponentOp to component lowering state.
Definition at line 592 of file CalyxLoweringUtils.h.
Referenced by getState().
|
private |
The name of this top-level function.
Definition at line 587 of file CalyxLoweringUtils.h.
Referenced by getTopLevelFunction().