diff options
author | Sam Feifer <sfeifer@redhat.com> | 2022-07-29 09:44:48 -0400 |
---|---|---|
committer | Sam Feifer <sfeifer@redhat.com> | 2022-08-01 09:01:53 -0400 |
commit | 388fbbd895e72669909173c3003ae65c6483a3c2 (patch) | |
tree | 6f06ba7584c2bfc8a744d1fd3fddb270e450e66c /gcc/omp-simd-clone.cc | |
parent | 71f068a9b3332a2179dfc807cf9138f691d77461 (diff) | |
download | gcc-388fbbd895e72669909173c3003ae65c6483a3c2.zip gcc-388fbbd895e72669909173c3003ae65c6483a3c2.tar.gz gcc-388fbbd895e72669909173c3003ae65c6483a3c2.tar.bz2 |
match.pd: Add new division pattern [PR104992]
This patch fixes a missed optimization in match.pd. It takes the pattern,
x / y * y == x, and optimizes it to x % y == 0. This produces fewer
instructions. This simplification does not happen for complex types.
This patch also adds tests for the optimization rule.
Bootstrapped/regtested on x86_64-pc-linux-gnu.
PR tree-optimization/104992
gcc/ChangeLog:
* match.pd (x / y * y == x): New simplification.
gcc/testsuite/ChangeLog:
* g++.dg/pr104992-1.C: New test.
* gcc.dg/pr104992.c: New test.
Diffstat (limited to 'gcc/omp-simd-clone.cc')
0 files changed, 0 insertions, 0 deletions