diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2024-10-24 14:22:32 +0100 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2024-10-24 14:22:32 +0100 |
commit | 8d01bc7dc453a44cd5b1913fb8a4104ee56fa410 (patch) | |
tree | a2705980ff0efadd28b6a19f3c16c23d92f92fc2 /gcc/fortran/options.cc | |
parent | b381e84c4ecd72029effe1f8919d3aaea0fbd86b (diff) | |
download | gcc-8d01bc7dc453a44cd5b1913fb8a4104ee56fa410.zip gcc-8d01bc7dc453a44cd5b1913fb8a4104ee56fa410.tar.gz gcc-8d01bc7dc453a44cd5b1913fb8a4104ee56fa410.tar.bz2 |
Generalise ((X /[ex] A) +- B) * A -> X +- A * B rule
match.pd had a rule to simplify ((X /[ex] A) +- B) * A -> X +- A * B
when A and B are INTEGER_CSTs. This patch extends it to handle the
case where the outer multiplication is by a factor of A, not just
A itself. It also handles addition and multiplication of poly_ints.
(Exact division by a poly_int seems unlikely.)
gcc/
* match.pd: Generalise ((X /[ex] A) +- B) * A -> X +- A * B rule
to ((X /[ex] C1) +- C2) * (C1 * C3) -> (X * C3) +- (C1 * C2 * C3).
gcc/testsuite/
* gcc.dg/tree-ssa/mulexactdiv-5.c: New test.
* gcc.dg/tree-ssa/mulexactdiv-6.c: Likewise.
* gcc.dg/tree-ssa/mulexactdiv-7.c: Likewise.
* gcc.dg/tree-ssa/mulexactdiv-8.c: Likewise.
* gcc.target/aarch64/sve/cnt_fold_3.c: Likewise.
Diffstat (limited to 'gcc/fortran/options.cc')
0 files changed, 0 insertions, 0 deletions