https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56719

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:d96b8556e569a1ccce36ef990e167031d07a661a

commit r11-6374-gd96b8556e569a1ccce36ef990e167031d07a661a
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Thu Dec 31 10:19:06 2020 +0100

    reassoc: Optimize x > 0x1fff || y > 0x1fff into (x | y) > 0x1fff [PR56719]

    The following patch adds an optimization mentioned in PR56719 #c8.
    We already have the x != 0 && y != 0 && z != 0 into (x | y | z) != 0
    and x != -1 && y != -1 && y != -1 into (x & y & z) != -1
    optimizations, this patch just extends that to
    x < C && y < C && z < C for power of two constants C into
    (x | y | z) < C (for unsigned comparisons).

    I didn't want to create too many buckets (there can be TYPE_PRECISION such
    constants), so the patch instead just uses one buckets for all such
    constants and loops over that bucket up to TYPE_PRECISION times.

    2020-12-31  Jakub Jelinek  <ja...@redhat.com>

            PR tree-optimization/56719
            * tree-ssa-reassoc.c (optimize_range_tests_cmp_bitwise): Also
optimize
            x < C && y < C && z < C when C is a power of two constant into
            (x | y | z) < C.

            * gcc.dg/tree-ssa/pr56719.c: New test.

Reply via email to