Skip to content

Commit

Permalink
Bugfix: cprop rule: (x + k1) - k2 becomes x - (k2 - k1), not `x -…
Browse files Browse the repository at this point in the history
… (k1 - k2)`.
  • Loading branch information
cfallin committed Dec 6, 2022
1 parent 0c98b9a commit 40928ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cranelift/codegen/src/opts/cprop.isle
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
(rule (simplify (isub ty
(iadd ty x (iconst ty (u64_from_imm64 k1)))
(iconst ty (u64_from_imm64 k2))))
(isub ty x (iconst ty (imm64 (u64_sub k1 k2)))))
(isub ty x (iconst ty (imm64 (u64_sub k2 k1)))))
(rule (simplify (iadd ty
(isub ty x (iconst ty (u64_from_imm64 k1)))
(iconst ty (u64_from_imm64 k2))))
Expand Down

0 comments on commit 40928ab

Please sign in to comment.