[PATCH PR82439][simplify-rtx] Simplify (x | y) == x -> (y & ~x) == 0
commit5b6f66f36f1a121514d0a104fad25b8cb6603a39
authorsudi <sudi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Jan 2018 10:45:37 +0000 (5 10:45 +0000)
committersudi <sudi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Jan 2018 10:45:37 +0000 (5 10:45 +0000)
tree0d732f1a8c2df27c03d68a309676fa6b4895de39
parent8c9c312599ad7ea97348d8afaa8f430dd0b5cdda
[PATCH PR82439][simplify-rtx] Simplify (x | y) == x -> (y & ~x) == 0

This patch add support for the missing transformation of
(x | y) == x -> (y & ~x) == 0. The transformation for (x & y) == x case
already exists in simplify-rtx.c since 2014 as of r218503 and this patch
only adds a couple of extra patterns for the IOR case. This benefits
targets that have the BICS instruction to generate better code. For
targets that do not have the BICS instructions, it still results in
no worse code generation and gives out 2 instructions.

ChangeLog Entries:

*** gcc/ChangeLog ***

2018-01-05  Sudakshina Das  <sudi.das@arm.com>

PR target/82439
* simplify-rtx.c (simplify_relational_operation_1): Add simplifications
of (x|y) == x for BICS pattern.

*** gcc/testsuite/ChangeLog ***

2018-01-05  Sudakshina Das  <sudi.das@arm.com>

PR target/82439
* gcc.target/aarch64/bics_5.c: New test.
* gcc.target/arm/bics_5.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256275 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/simplify-rtx.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/bics_5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/bics_5.c [new file with mode: 0644]