> On Nov 27, 2025, at 8:16 AM, Jakub Jelinek <[email protected]> wrote: > > On Thu, Nov 27, 2025 at 09:02:20PM +0800, Dongyan Chen wrote: >> This patch implements an optimization to transform (a * b) == 0 to >> (a == 0) || (b == 0) for signed and unsigned integer. > > Shouldn't that just optimize to (a | b) == 0 > instead? At least when a and b have the same type. I would think that (a==0) || (b==0) would optimize already to (a|b)==0 provided b has no side effects. paul
- [PATCH] Match: Optimize (a * b) == 0 to (a == 0) || (b == 0... Dongyan Chen
- Re: [PATCH] Match: Optimize (a * b) == 0 to (a == 0) |... Jakub Jelinek
- Re: [PATCH] Match: Optimize (a * b) == 0 to (a == ... Paul Koning
- Re: [PATCH] Match: Optimize (a * b) == 0 to (a... Richard Biener
- Re: [PATCH] Match: Optimize (a * b) == 0 to (a == ... Dongyan Chen
- Re: [PATCH] Match: Optimize (a * b) == 0 to (a == 0) |... Andrew Pinski
