Re: [PATCH 2/9] Use get_nonzero_bits to simplify trunc_div to exact_div

2024-10-18 Thread Richard Biener
On Fri, 18 Oct 2024, Richard Sandiford wrote: > There are a limited number of existing rules that benefit from > knowing that a division is exact. Later patches will add more. OK. Thanks, Richard. > gcc/ > * match.pd: Simplify X / (1 << C) to X /[ex] (1 << C) if the > low C bits of

[PATCH 2/9] Use get_nonzero_bits to simplify trunc_div to exact_div

2024-10-18 Thread Richard Sandiford
There are a limited number of existing rules that benefit from knowing that a division is exact. Later patches will add more. gcc/ * match.pd: Simplify X / (1 << C) to X /[ex] (1 << C) if the low C bits of X are clear gcc/testsuite/ * gcc.dg/tree-ssa/cmpexactdiv-6.c: New