aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-loop-distribution.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-01-11 10:32:07 +0100
committerJakub Jelinek <jakub@redhat.com>2021-01-11 10:32:19 +0100
commita2106317cd6673e110b347c70f21e25fbb23379e (patch)
treea7f2fa222c89b85f8e86db28c9ab3fc906845719 /gcc/tree-loop-distribution.c
parent64dc013853b5a414bfe70727010942e3f872c402 (diff)
downloadgcc-a2106317cd6673e110b347c70f21e25fbb23379e.zip
gcc-a2106317cd6673e110b347c70f21e25fbb23379e.tar.gz
gcc-a2106317cd6673e110b347c70f21e25fbb23379e.tar.bz2
widening_mul: Pattern recognize unsigned multiplication with overflow check [PR95852]
The following patch pattern recognizes some forms of multiplication followed by overflow check through division by one of the operands compared to the other one, with optional removal of guarding non-zero check for that operand if possible. The patterns are replaced with effectively __builtin_mul_overflow or __builtin_mul_overflow_p. The testcases cover 64 different forms of that. 2021-01-11 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/95852 * tree-ssa-math-opts.c (maybe_optimize_guarding_check): New function. (uaddsub_overflow_check_p): Renamed to ... (arith_overflow_check_p): ... this. Handle also multiplication with overflow check. (match_uaddsub_overflow): Renamed to ... (match_arith_overflow): ... this. Add cfg_changed argument. Handle also multiplication with overflow check. Adjust function comment. (math_opts_dom_walker::after_dom_children): Adjust callers. Call match_arith_overflow also for MULT_EXPR. * gcc.target/i386/pr95852-1.c: New test. * gcc.target/i386/pr95852-2.c: New test.
Diffstat (limited to 'gcc/tree-loop-distribution.c')
0 files changed, 0 insertions, 0 deletions