Skip to content

Commit

Permalink
sasha comment final
Browse files Browse the repository at this point in the history
  • Loading branch information
dshaaban01 committed Feb 13, 2024
1 parent c5256d3 commit 0da02cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions xdsl/interactive/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def compute_available_pass_list(self) -> tuple[AvailablePass, ...]:
individual_rewrite.REWRITE_BY_NAMES,
)
rewrites_as_pass_list: tuple[AvailablePass, ...] = ()
for op_idx, (op_name, pat_name) in rewrites:
for op, op_idx, (op_name, pat_name) in rewrites:
rewrite_pass = individual_rewrite.IndividualRewrite
rewrite_spec = PipelinePassSpec(
name=rewrite_pass.name,
Expand All @@ -267,7 +267,6 @@ def compute_available_pass_list(self) -> tuple[AvailablePass, ...]:
"pattern_name": [pat_name],
},
)
op = list(self.current_module.walk())[op_idx]
rewrites_as_pass_list = (
*rewrites_as_pass_list,
(
Expand Down
6 changes: 5 additions & 1 deletion xdsl/interactive/get_all_possible_rewrites.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import NamedTuple

from xdsl.dialects.builtin import ModuleOp
from xdsl.ir import Operation
from xdsl.pattern_rewriter import PatternRewriter, RewritePattern


Expand All @@ -18,6 +19,7 @@ class IndexedIndividualRewrite(NamedTuple):
Type alias for a specific rewrite pattern, additionally consisting of its operation index.
"""

matched_op: Operation
operation_index: int
rewrite: IndividualRewrite

Expand Down Expand Up @@ -51,7 +53,9 @@ def get_all_possible_rewrites(
*res,
(
IndexedIndividualRewrite(
op_idx, IndividualRewrite(matched_op.name, pattern_name)
matched_op,
op_idx,
IndividualRewrite(matched_op.name, pattern_name),
)
),
)
Expand Down

0 comments on commit 0da02cc

Please sign in to comment.