15#define GEN_PASS_DEF_UNIQUEVALIDATEOPSPASS
16#include "circt/Dialect/RTG/Transforms/RTGPasses.h.inc"
29struct UniqueValidateOpsPass
30 :
public rtg::impl::UniqueValidateOpsPassBase<UniqueValidateOpsPass> {
33 void runOnOperation()
override;
37void UniqueValidateOpsPass::runOnOperation() {
39 SmallVector<ValidateOp> validateOps;
42 getOperation()->walk([&](ValidateOp op) {
43 if (op.getId().has_value())
44 names.
add(op.getId().value());
46 validateOps.push_back(op);
49 for (
auto op : validateOps) {
50 auto newName = names.
newName(
"validation_id");
A namespace that is used to store existing names and generate new names in some scope within the IR.
void add(mlir::ModuleOp module)
StringRef newName(const Twine &name)
Return a unique name, derived from the input name, and add the new name to the internal namespace.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.