[3/3][RTL ifcvt] PR middle-end/37780: Conditional expression with __builtin_clz(...
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Mon, 6 Jun 2016 16:06:05 +0000 (16:06 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Mon, 6 Jun 2016 16:06:05 +0000 (16:06 +0000)
commit36f9ad69336aeee0aa7cf2d8640fccbec8d659e1
treebcfb07a9b834a240baa5c8658d3bcc74e6499f2b
parente8536e2b9f96f42d7f12f13254300476debd283a
[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.

From-SVN: r237141
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]