Cranelift: Rewrite or(and(x, y), not(y)) => or(x, not(y)) again (#5684)

This rewrite was introduced in #5676 and then reverted in #5682 due to a footgun
where we accidentally weren't actually checking the `y == !z` precondition. This
commit fixes the precondition check. It also fixes the arithmetic to be
correctly masked to the value type's width.

This reverts commit 268f6bfc1d.
This commit is contained in:
Nick Fitzgerald
2023-02-01 12:53:22 -08:00
committed by GitHub
parent 91b8a2c527
commit ffbbfbffce
5 changed files with 177 additions and 1 deletions

View File

@@ -109,6 +109,11 @@ macro_rules! isle_common_prelude_methods {
!x
}
#[inline]
fn u64_eq(&mut self, x: u64, y: u64) -> bool {
x == y
}
#[inline]
fn u64_is_zero(&mut self, value: u64) -> bool {
0 == value