Walk
Walk dataclass
Walk(
rule: RewriteRule,
worklist: WorkList[IRNode] = WorkList(),
skip: Callable[[IRNode], bool] = lambda _: False,
reverse: bool = False,
region_first: bool = False,
)
Bases: RewriteRule
Walk through the IR nodes and apply a rewrite rule.
The walk will apply the rewrite rule to each node in the IR tree in a depth-first order.
Parameters
map
: The rewrite rule to apply.reverse
: Whether to traverse the IR tree in reverse order. Default isFalse
.region_first
: Whether to traverse the regions before the blocks. Default isFalse
.