diff --git a/tests/filecheck/transforms/apply-eqsat-pdl/apply_eqsat_pdl_swap_inputs.mlir b/tests/filecheck/transforms/apply-eqsat-pdl/apply_eqsat_pdl_swap_inputs.mlir index 12b4365af1..b09211c3a6 100644 --- a/tests/filecheck/transforms/apply-eqsat-pdl/apply_eqsat_pdl_swap_inputs.mlir +++ b/tests/filecheck/transforms/apply-eqsat-pdl/apply_eqsat_pdl_swap_inputs.mlir @@ -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: } diff --git a/xdsl/interpreters/eqsat_pdl.py b/xdsl/interpreters/eqsat_pdl.py index 5fc1dbbbb3..564b750be7 100644 --- a/xdsl/interpreters/eqsat_pdl.py +++ b/xdsl/interpreters/eqsat_pdl.py @@ -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: