def METHOD_NAME(self, ctx: MLContext, op: ModuleOp) -> None:
    walker1 = PatternRewriteWalker(
        GreedyRewritePatternApplier(
            [
                LowerGetInfoOpToFunc(),
                LowerBarrierOpToFunc(),
                LowerDma1DOpToFunc(),
                LowerDma2DOpToFunc(),
            ]
        ),
        apply_recursively=True,
    )
    walker2 = PatternRewriteWalker(AddExternalFuncs())
    walker1.rewrite_module(op)
    walker2.rewrite_module(op)