match.pd: Optimize ffs comparisons against constants [PR95527]
authorJakub Jelinek <jakub@redhat.com>
Tue, 9 Jun 2020 06:38:19 +0000 (08:38 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 9 Jun 2020 06:38:19 +0000 (08:38 +0200)
commit653ab081391e9e7e38b304f3234323c93693d40c
treed47fff87fa78625528b5c945800858dc9749c3f2
parent9a39b91d934e7acd8f3a9767b6d5febe90168d0d
match.pd: Optimize ffs comparisons against constants [PR95527]

The following patch implements various optimizations of __builtin_ffs*
against constants.

2020-06-09  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/95527
* match.pd (__builtin_ffs (X) cmp CST): New optimizations.

* gcc.dg/tree-ssa/pr95527.c: New test.
gcc/match.pd
gcc/testsuite/gcc.dg/tree-ssa/pr95527.c [new file with mode: 0644]