From 62f67d0f7aad2b7fc34b95aff7214b276e8f179e Mon Sep 17 00:00:00 2001 From: oflatt Date: Fri, 8 Nov 2024 11:09:54 -0800 Subject: [PATCH] issue link, snapshots --- .../src/optimizations/loop_strength_reduction.egg | 3 ++- dag_in_context/src/utility/util.egg | 2 ++ ...g__optimize_direct_jumps__add_block_ind_test.snap | 12 ------------ 3 files changed, 4 insertions(+), 13 deletions(-) delete mode 100644 src/rvsdg/snapshots/eggcc__rvsdg__optimize_direct_jumps__add_block_ind_test.snap diff --git a/dag_in_context/src/optimizations/loop_strength_reduction.egg b/dag_in_context/src/optimizations/loop_strength_reduction.egg index b32b74fe1..19bf0e1f0 100644 --- a/dag_in_context/src/optimizations/loop_strength_reduction.egg +++ b/dag_in_context/src/optimizations/loop_strength_reduction.egg @@ -96,7 +96,8 @@ ; Subsume the multiplication in the new loop to prevent ; from firing loop strength reduction again on the new loop - ; subsumption needs something to subsume, add it here + ; Workaround of egglog issue: https://github.com/egraphs-good/egglog/issues/462 + ; add the expression we are about to subsume (let before (Bop (Mul) new-c (Get replace-arg i))) ; now subsume it diff --git a/dag_in_context/src/utility/util.egg b/dag_in_context/src/utility/util.egg index 478ef9d6b..711b04614 100644 --- a/dag_in_context/src/utility/util.egg +++ b/dag_in_context/src/utility/util.egg @@ -68,6 +68,8 @@ (ruleset subsume-after-helpers) ;; After running the `saturating` ruleset, these if statements can be subsumed (relation ToSubsumeIf (Expr Expr Expr Expr)) +;; Workaround of https://github.com/egraphs-good/egglog/issues/462 +;; Make sure the if we are subsuming is present (rule ((ToSubsumeIf a b c d) (If a b c d)) ((subsume (If a b c d))) diff --git a/src/rvsdg/snapshots/eggcc__rvsdg__optimize_direct_jumps__add_block_ind_test.snap b/src/rvsdg/snapshots/eggcc__rvsdg__optimize_direct_jumps__add_block_ind_test.snap deleted file mode 100644 index d1e67ea51..000000000 --- a/src/rvsdg/snapshots/eggcc__rvsdg__optimize_direct_jumps__add_block_ind_test.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -source: src/rvsdg/optimize_direct_jumps.rs -expression: cfg.optimize_jumps().to_bril().to_string() ---- -@main { -.exit___: - v0: int = const 1; - v1: int = const 2; - v2: int = add v0 v1; - print v2; - ret; -}