Constant fold interp
constant_fold_interp
¶
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.
ConstantFoldInterpPattern
dataclass
¶
Bases: RewritePattern
Source code in xdsl/transforms/constant_fold_interp.py
ctx: Context
instance-attribute
¶
interpreter: Interpreter
instance-attribute
¶
__init__(ctx: Context, interpreter: Interpreter) -> None
¶
match_and_rewrite(op: Operation, rewriter: PatternRewriter)
¶
Source code in xdsl/transforms/constant_fold_interp.py
convert_to_attr(value: Any, value_type: Attribute) -> Attribute | None
¶
ConstantFoldInterpPass
dataclass
¶
Bases: ModulePass
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.