]> git.ipfire.org Git - thirdparty/gcc.git/commit
Make more places handle exact_div like trunc_div
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 24 Oct 2024 13:22:30 +0000 (14:22 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 24 Oct 2024 13:22:30 +0000 (14:22 +0100)
commit3e93828e601c62176ea2b4a1dd0b5a1db5657a8e
tree5da2f31d92daecbf68db80897b963d0a7ff2c5ab
parentf24e10876689dcd92b05756bd3ec833ddf1e6b7e
Make more places handle exact_div like trunc_div

I tried to look for places where we were handling TRUNC_DIV_EXPR
more favourably than EXACT_DIV_EXPR.

Most of the places that I looked at but didn't change were handling
div/mod pairs.  But there's bound to be others I missed...

gcc/
* match.pd: Extend some rules to handle exact_div like trunc_div.
* tree.h (trunc_or_exact_div_p): New function.
* tree-ssa-loop-niter.cc (is_rshift_by_1): Use it.
* tree-ssa-loop-ivopts.cc (force_expr_to_var_cost): Handle
EXACT_DIV_EXPR.
gcc/match.pd
gcc/tree-ssa-loop-ivopts.cc
gcc/tree-ssa-loop-niter.cc
gcc/tree.h