As in https://gcc.gnu.org/pipermail/gcc-patches/2024-September/663185.html,
this patch guards the simplification x / y * y == x -> x % y == 0 in
match.pd for vector types by a check for:
1) Support of the mod optab for vectors OR
2) Application before vector lowering for non-VL vectors.

The patch was bootstrapped and tested with no regression on
aarch64-linux-gnu and x86_64-linux-gnu.
OK for mainline?

Signed-off-by: Jennifer Schmitz <jschm...@nvidia.com>

gcc/
        PR tree-optimization/116831
        * match.pd: Guard simplification to trunc_mod with check for
        mod optab support.

gcc/testsuite/
        PR tree-optimization/116831
        * gcc.dg/torture/pr116831.c: New test.

Attachment: 0001-PR116831-match.pd-Check-trunc_mod-vector-obtap-befor.patch
Description: Binary data

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to