]> git.ipfire.org Git - thirdparty/gcc.git/commit
MATCH: Simplify `a rrotate (32-b) -> a lrotate b` [PR109906]
authorEikansh Gupta <quic_eikagupt@quicinc.com>
Mon, 11 Nov 2024 11:36:04 +0000 (17:06 +0530)
committerAndrew Pinski <quic_apinski@quicinc.com>
Thu, 14 Nov 2024 08:37:33 +0000 (00:37 -0800)
commit879c1619ab5a708514cbb1f3754e59f30ba29e6c
treeee43624a03c8bb32874baf428bd04c2516947dd9
parent6d85a0bc2e09221bdb412bc47aefbcd10c546fd5
MATCH: Simplify `a rrotate (32-b) -> a lrotate b` [PR109906]

The pattern `a rrotate (32-b)` should be optimized to `a lrotate b`.
The same is also true for `a lrotate (32-b)`. It can be optimized to
`a rrotate b`.

This patch adds following patterns:
a rrotate (32-b) -> a lrotate b
a lrotate (32-b) -> a rrotate b

Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR tree-optimization/109906

gcc/ChangeLog:

* match.pd (a rrotate (32-b) -> a lrotate b): New pattern
(a lrotate (32-b) -> a rrotate b): New pattern

gcc/testsuite/ChangeLog:

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

Signed-off-by: Eikansh Gupta <quic_eikagupt@quicinc.com>
gcc/match.pd
gcc/testsuite/gcc.dg/tree-ssa/pr109906.c [new file with mode: 0644]