CIRCT
20.0.0git
|
Instantiate one of these and use it to build typed backedges. More...
#include <BackedgeBuilder.h>
Public Member Functions | |
BackedgeBuilder (mlir::OpBuilder &builder, mlir::Location loc) | |
To build a backedge op and manipulate it, we need a PatternRewriter and a Location . More... | |
BackedgeBuilder (mlir::PatternRewriter &rewriter, mlir::Location loc) | |
~BackedgeBuilder () | |
Backedge | get (mlir::Type resultType, mlir::LocationAttr optionalLoc={}) |
Create a typed backedge. More... | |
mlir::LogicalResult | clearOrEmitError () |
Clear the backedges, erasing any remaining cursor ops. More... | |
void | abandon () |
Abandon the backedges, suppressing any diagnostics if they are still active upon destruction of the backedge builder. More... | |
Private Attributes | |
mlir::OpBuilder & | builder |
mlir::PatternRewriter * | rewriter |
mlir::Location | loc |
llvm::SmallVector< mlir::Operation *, 16 > | edges |
Friends | |
class | Backedge |
Instantiate one of these and use it to build typed backedges.
Backedges which get used as operands must be assigned to with the actual value before this class is destructed, usually at the end of a scope. It will check that invariant then erase all the backedge ops during destruction.
Example use:
Definition at line 46 of file BackedgeBuilder.h.
circt::BackedgeBuilder::BackedgeBuilder | ( | mlir::OpBuilder & | builder, |
mlir::Location | loc | ||
) |
To build a backedge op and manipulate it, we need a PatternRewriter
and a Location
.
Store them during construct of this instance and use them when building.
circt::BackedgeBuilder::BackedgeBuilder | ( | mlir::PatternRewriter & | rewriter, |
mlir::Location | loc | ||
) |
BackedgeBuilder::~BackedgeBuilder | ( | ) |
Definition at line 35 of file BackedgeBuilder.cpp.
References clearOrEmitError().
void BackedgeBuilder::abandon | ( | ) |
Abandon the backedges, suppressing any diagnostics if they are still active upon destruction of the backedge builder.
Also, any currently existing cursor ops will be abandoned.
Definition at line 59 of file BackedgeBuilder.cpp.
References edges.
LogicalResult BackedgeBuilder::clearOrEmitError | ( | ) |
Clear the backedges, erasing any remaining cursor ops.
Returns failure
and emits diagnostic messages if a backedge is still active.
Definition at line 37 of file BackedgeBuilder.cpp.
References edges, loc, and rewriter.
Referenced by ~BackedgeBuilder().
Backedge BackedgeBuilder::get | ( | mlir::Type | resultType, |
mlir::LocationAttr | optionalLoc = {} |
||
) |
Create a typed backedge.
If no location is provided, the one passed to the constructor will be used.
Definition at line 65 of file BackedgeBuilder.cpp.
References Backedge, builder, edges, and loc.
Referenced by circt::handshake::HandshakeLowering::insertMerge(), instantiateSystemVerilogMemory(), lockRegion(), and circt::hw::PortConverterImpl::updateInstance().
|
friend |
Definition at line 47 of file BackedgeBuilder.h.
Referenced by get().
|
private |
Definition at line 71 of file BackedgeBuilder.h.
Referenced by get().
|
private |
Definition at line 74 of file BackedgeBuilder.h.
Referenced by Python.support.BackedgeBuilder::__exit__(), Python.support.BackedgeBuilder::_create(), abandon(), clearOrEmitError(), and get().
|
private |
Definition at line 73 of file BackedgeBuilder.h.
Referenced by clearOrEmitError(), and get().
|
private |
Definition at line 72 of file BackedgeBuilder.h.
Referenced by clearOrEmitError().