Skip to content

Commit

Permalink
copy name hint when rewriting
Browse files Browse the repository at this point in the history
  • Loading branch information
superlopuh committed Nov 18, 2024
1 parent f5157af commit 8c4fdf4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
// CHECK-NEXT: %c4_eq = eqsat.eclass %c4 : i32
// CHECK-NEXT: %c2 = arith.constant 2 : i32
// CHECK-NEXT: %c2_eq = eqsat.eclass %c2 : i32
// CHECK-NEXT: %0 = arith.addi %c2_eq, %c4_eq : i32
// CHECK-NEXT: %sum = arith.addi %c4_eq, %c2_eq : i32
// CHECK-NEXT: %sum_eq = eqsat.eclass %sum, %0 : i32
// CHECK-NEXT: %sum = arith.addi %c2_eq, %c4_eq : i32
// CHECK-NEXT: %sum_1 = arith.addi %c4_eq, %c2_eq : i32
// CHECK-NEXT: %sum_eq = eqsat.eclass %sum_1, %sum : i32
// CHECK-NEXT: func.return %sum_eq : i32
// CHECK-NEXT: }

Expand Down
1 change: 1 addition & 0 deletions xdsl/interpreters/eqsat_pdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def run_replace(
# Add new op to eclass
results = new_op.results
assert len(results) == 1
results[0].name_hint = old.results[0].name_hint
eclass_op = self.value_to_eclass[old.results[0]]
eclass_op.operands = eclass_op.arguments + results
elif op.repl_values:
Expand Down

0 comments on commit 8c4fdf4

Please sign in to comment.