11#include "mlir/IR/PatternMatch.h"
15#define GEN_PASS_DEF_MATERIALIZECONSTRAINTSPASS
16#include "circt/Dialect/RTG/Transforms/RTGPasses.h.inc"
29struct MaterializeConstraintsPass
30 :
public rtg::impl::MaterializeConstraintsPassBase<
31 MaterializeConstraintsPass> {
33 void runOnOperation()
override;
37void MaterializeConstraintsPass::runOnOperation() {
38 getOperation()->walk([&](ImplicitConstraintOpInterface op) {
39 if (op.isConstraintMaterialized())
42 OpBuilder builder(op);
43 builder.setInsertionPointAfter(op);
44 auto *newOp = op.materializeConstraint(builder);
47 if (newOp && op->getNumResults() > 0)
48 op->replaceAllUsesWith(newOp);
50 op->getNumResults() == 0 &&
51 "cannot erase operation without result value replacements");
assert(baseType &&"element must be base type")
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.