diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-04-27 14:45:45 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2021-04-27 14:45:45 +0200 |
commit | 3dcd1334b4f522352b80814513fdca902fc2a207 (patch) | |
tree | ba22865f280b62b887ab9dc5c9c065aeebcdcf32 /gcc/cse.c | |
parent | eea82246290010addf7f6be71a71b51079b3cb5d (diff) | |
download | gcc-3dcd1334b4f522352b80814513fdca902fc2a207.zip gcc-3dcd1334b4f522352b80814513fdca902fc2a207.tar.gz gcc-3dcd1334b4f522352b80814513fdca902fc2a207.tar.bz2 |
expand: Expand x / y * y as x - x % y if the latter is cheaper [PR96696]
The following patch tests both x / y * y and x - x % y expansion for the
former GIMPLE code and chooses the cheaper of those sequences.
2021-04-27 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/96696
* expr.c (expand_expr_divmod): New function.
(expand_expr_real_2) <case TRUNC_DIV_EXPR>: Use it for truncations and
divisions. Formatting fixes.
<case MULT_EXPR>: Optimize x / y * y as x - x % y if the latter is
cheaper.
* gcc.target/i386/pr96696.c: New test.
Diffstat (limited to 'gcc/cse.c')
0 files changed, 0 insertions, 0 deletions