Func to pdl rewrite
func_to_pdl_rewrite
A pass that applies the interpreter to operations with no side effects where all the inputs are constant, replacing the computation with a constant value.
FuncOpToPdlRewritePattern
dataclass
Bases: RewritePattern
Rewrite pattern that transforms a function into a PDL rewrite operation.
Source code in xdsl/transforms/experimental/func_to_pdl_rewrite.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
__init__() -> None
match_and_rewrite(op: func.FuncOp, rewriter: PatternRewriter)
Source code in xdsl/transforms/experimental/func_to_pdl_rewrite.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
ReturnOpToPdlRewritePattern
dataclass
Bases: RewritePattern
Rewrite pattern that erases return ops in PDL rewrite operations.
Source code in xdsl/transforms/experimental/func_to_pdl_rewrite.py
44 45 46 47 48 49 50 | |
__init__() -> None
match_and_rewrite(op: func.ReturnOp, rewriter: PatternRewriter)
Source code in xdsl/transforms/experimental/func_to_pdl_rewrite.py
48 49 50 | |
FuncToPdlRewrite
dataclass
Bases: ModulePass
A pass that transforms a function into a PDL rewrite operation.
Source code in xdsl/transforms/experimental/func_to_pdl_rewrite.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
name = 'func-to-pdl-rewrite'
class-attribute
instance-attribute
apply(ctx: Context, op: builtin.ModuleOp) -> None
Apply the pass.
Source code in xdsl/transforms/experimental/func_to_pdl_rewrite.py
60 61 62 63 64 65 66 67 68 69 | |