Skip to content

Commit

Permalink
Address some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
math-fehr committed Jan 5, 2024
1 parent c10b00c commit b234f14
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions xdsl/pattern_rewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ class PatternRewriteWalker:

def _add_operands_to_worklist(self, operands: Iterable[SSAValue]) -> None:
"""
Add defining operations of SSA values to the worklist, if they have only
Add defining operations of SSA values to the worklist if they have only
one use. This is a heuristic based on the fact that single-use operations
have more canonicalization opportunities.
"""
Expand Down Expand Up @@ -837,23 +837,23 @@ def _get_rewriter_listener(self) -> PatternRewriterListener:
listener passed as configuration to the walker.
"""
return PatternRewriterListener(
operation_insertion_handler=(
self.listener.operation_insertion_handler
+ [self._handle_operation_insertion]
),
operation_removal_handler=(
self.listener.operation_removal_handler
+ [self._handle_operation_removal]
),
operation_modification_handler=(
self.listener.operation_modification_handler
+ [self._handle_operation_modification]
),
operation_replacement_handler=(
self.listener.operation_replacement_handler
+ [self._handle_operation_replacement]
),
block_creation_handler=(self.listener.block_creation_handler),
operation_insertion_handler=[
*self.listener.operation_insertion_handler,
self._handle_operation_insertion,
],
operation_removal_handler=[
*self.listener.operation_removal_handler,
self._handle_operation_removal,
],
operation_modification_handler=[
*self.listener.operation_modification_handler,
self._handle_operation_modification,
],
operation_replacement_handler=[
*self.listener.operation_replacement_handler,
self._handle_operation_replacement,
],
block_creation_handler=self.listener.block_creation_handler,
)

def rewrite_module(self, module: ModuleOp) -> None:
Expand Down

0 comments on commit b234f14

Please sign in to comment.