15 #ifndef CIRCT_SUPPORT_BACKEDGEBUILDER_H
16 #define CIRCT_SUPPORT_BACKEDGEBUILDER_H
18 #include "mlir/IR/Location.h"
19 #include "mlir/IR/Value.h"
20 #include "llvm/ADT/SmallVector.h"
24 class PatternRewriter;
59 Backedge get(mlir::Type resultType, mlir::LocationAttr optionalLoc = {});
74 llvm::SmallVector<mlir::Operation *, 16>
edges;
89 explicit operator bool()
const {
return !!
value; }
90 operator mlir::Value()
const {
return value; }
Instantiate one of these and use it to build typed backedges.
void abandon()
Abandon the backedges, suppressing any diagnostics if they are still active upon destruction of the b...
llvm::SmallVector< mlir::Operation *, 16 > edges
BackedgeBuilder(mlir::PatternRewriter &rewriter, mlir::Location loc)
Backedge get(mlir::Type resultType, mlir::LocationAttr optionalLoc={})
Create a typed backedge.
mlir::OpBuilder & builder
mlir::PatternRewriter * rewriter
mlir::LogicalResult clearOrEmitError()
Clear the backedges, erasing any remaining cursor ops.
BackedgeBuilder(mlir::OpBuilder &builder, mlir::Location loc)
To build a backedge op and manipulate it, we need a PatternRewriter and a Location.
Backedge is a wrapper class around a Value.
void setValue(mlir::Value)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.