| 222 | } |
| 223 | |
| 224 | LogicalResult applySinglePattern(ModuleOp module, StringRef patternName, |
| 225 | ArrayRef<std::size_t> disabledControlCounts) { |
| 226 | auto patternType = instantiatePatternType(patternName); |
| 227 | if (!patternType) |
| 228 | return failure(); |
| 229 | |
| 230 | RewritePatternSet patterns(module->getContext()); |
| 231 | patterns.add( |
| 232 | patternType->create(module->getContext(), 1, disabledControlCounts)); |
| 233 | FrozenRewritePatternSet frozenPatterns(std::move(patterns)); |
| 234 | return applyPatternsGreedily(module, frozenPatterns); |
| 235 | } |
| 236 | |
| 237 | // Helper to collect all gate types in a module |
| 238 | llvm::StringSet<> collectGateTypesInModule(ModuleOp module) { |
no test coverage detected