diff --git a/hercules_opt/src/loop_bound_canon.rs b/hercules_opt/src/loop_bound_canon.rs index 3c6dc7ae028cad477969705bd453aedb4dcb167b..e305e9dbb4380a148493e21fcfe018f85553593c 100644 --- a/hercules_opt/src/loop_bound_canon.rs +++ b/hercules_opt/src/loop_bound_canon.rs @@ -270,17 +270,20 @@ pub fn canonicalize_single_loop_bounds( edit.replace_all_uses_where(bound_id, new_condition, |usee| *usee == binop_node)?; } - // Add back to uses of the IV - for user in update_expr_users { - let new_user = Node::Binary { - left: user, - right: *initializer, - op: BinaryOperator::Add, - }; - let new_user = edit.add_node(new_user); - edit = edit.replace_all_uses(user, new_user)?; - } + // for user in update_expr_users { + // let new_user = Node::Binary { + // left: user, + // right: *initializer, + // op: BinaryOperator::Add, + // }; + // let new_user = edit.add_node(new_user); + // edit = edit.replace_all_uses(user, new_user)?; + // } + + // for + + // Add the offset back to users of the IV update expression let new_user = Node::Binary { left: *update_expression, right: *initializer, @@ -294,6 +297,7 @@ pub fn canonicalize_single_loop_bounds( && *usee != condition_node })?; + // Add the offset back to users of the IV directly let new_user = Node::Binary { left: *iv_phi, right: *initializer, diff --git a/juno_samples/cava/src/cpu.sch b/juno_samples/cava/src/cpu.sch index 1b595b052582740c0a4886041fa8de2d54cfc5b2..4013fd277051b425b116486be78a6555e920b2d7 100644 --- a/juno_samples/cava/src/cpu.sch +++ b/juno_samples/cava/src/cpu.sch @@ -38,6 +38,7 @@ fixpoint { } simpl!(fuse1); array-slf(fuse1); +loop-bound-canon(fuse1); inline(fuse2); no-memset(fuse2@res); diff --git a/juno_samples/fork_join_tests/src/cpu.sch b/juno_samples/fork_join_tests/src/cpu.sch index ad226a7aa7c9d2270f4480b8825324198046521a..c71aec111f42aad90c383f8b42f622037efac60c 100644 --- a/juno_samples/fork_join_tests/src/cpu.sch +++ b/juno_samples/fork_join_tests/src/cpu.sch @@ -25,11 +25,8 @@ gvn(*); phi-elim(*); dce(*); -xdot[true](auto.test2); -lift-dc-math(auto.test2); -xdot[true](auto.test2); -loop-bound-canon(auto.test2); -xdot[true](auto.test2); +lift-dc-math(*); +loop-bound-canon(*); fixpoint panic after 20 { forkify(*); @@ -38,8 +35,6 @@ fixpoint panic after 20 { dce(*); } -xdot[true](auto.test2); - dce(*); gvn(*);