[3/3][RTL ifcvt] PR middle-end/37780: Conditional expression with __builtin_clz(...
commit837679bc2df5f04edeab96c8f494c7cbdfe67c9f
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Jun 2016 16:06:05 +0000 (6 16:06 +0000)
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Jun 2016 16:06:05 +0000 (6 16:06 +0000)
treebcfb07a9b834a240baa5c8658d3bcc74e6499f2b
parent93377bfd47faf5b7e869ecf142d952a67f6963ef
[3/3][RTL ifcvt] PR middle-end/37780: Conditional expression with __builtin_clz() should be optimized out

PR middle-end/37780
* ifcvt.c (noce_try_ifelse_collapse): New function.
Declare prototype.
(noce_process_if_block): Call noce_try_ifelse_collapse.
* simplify-rtx.c (simplify_cond_clz_ctz): New function.
(simplify_ternary_operation): Use the above to simplify
conditional CLZ/CTZ expressions.

* gcc.c-torture/execute/pr37780.c: New test.
* gcc.target/aarch64/pr37780_1.c: Likewise.
* gcc.target/arm/pr37780_1.c: Likewise.

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