match.pd: Optimize (((type)A * B) >> prec) != 0 into __imag__ .MUL_OVERFLOW [PR94914]
authorJakub Jelinek <jakub@redhat.com>
Tue, 5 May 2020 09:31:43 +0000 (11:31 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 5 May 2020 09:34:45 +0000 (11:34 +0200)
commit6d938a5d770d0e94ecd923d20006b05126659235
tree3f679604b715d12a623eb19e7df56d4171024b2d
parent59e4474a22cbf23b777f244d2a28d1ee4b54d3ce
match.pd: Optimize (((type)A * B) >> prec) != 0 into __imag__ .MUL_OVERFLOW [PR94914]

On x86 (the only target with umulv4_optab) one can use mull; seto to check
for overflow instead of performing wider multiplication and performing
comparison on the high bits.

2020-05-05  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/94914
* match.pd ((((type)A * B) >> prec) != 0 to .MUL_OVERFLOW(A, B) != 0):
New simplification.

* gcc.target/i386/pr94914.c: New test.
gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr94914.c [new file with mode: 0644]