Skip to content
Snippets Groups Projects
Commit 55fcaa9a authored by Andrew Pinski's avatar Andrew Pinski
Browse files

Add Plus to the op list of `(zero_one == 0) ? y : z <op> y` pattern

This adds plus to the op list of `(zero_one == 0) ? y : z <op> y` patterns
which currently has bit_ior and bit_xor.
This shows up now in GCC after the boolization work that Uroš has been doing.

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

	PR tree-optimization/97711
	PR tree-optimization/110155

gcc/ChangeLog:

	* match.pd ((zero_one == 0) ? y : z <op> y): Add plus to the op.
	((zero_one != 0) ? z <op> y : y): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/branchless-cond-add-2.c: New test.
	* gcc.dg/tree-ssa/branchless-cond-add.c: New test.
parent 52c92fb3
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