Skip to content
Snippets Groups Projects
Commit 879c1619 authored by Eikansh Gupta's avatar Eikansh Gupta Committed by Andrew Pinski
Browse files

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: default avatarEikansh Gupta <quic_eikagupt@quicinc.com>
parent 6d85a0bc
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment