Skip to content
Snippets Groups Projects
Commit 07921708 authored by Xavier Routh's avatar Xavier Routh
Browse files

loop canon bound fix

parent 8dabbb84
No related branches found
No related tags found
1 merge request!188Loop canon bound fix
Pipeline #201747 passed
This commit is part of merge request !188. Comments created here will be created in the context of that merge request.
......@@ -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,
......
......@@ -38,6 +38,7 @@ fixpoint {
}
simpl!(fuse1);
array-slf(fuse1);
loop-bound-canon(fuse1);
inline(fuse2);
no-memset(fuse2@res);
......
......@@ -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(*);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment