[RTL-ifcvt] Make non-conditional execution if-conversion more aggressive
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Tue, 1 Sep 2015 12:33:51 +0000 (12:33 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Tue, 1 Sep 2015 12:33:51 +0000 (12:33 +0000)
commite65bf4e814d38c87232445a9cb6f995678d70095
tree29c71966823c22f1f859dbddac68e205f0c9364d
parent2674213872182bcf844b0f495478cf168b0bb3d8
[RTL-ifcvt] Make non-conditional execution if-conversion more aggressive

* ifcvt.c (struct noce_if_info): Add then_simple, else_simple,
then_cost, else_cost fields.  Change branch_cost field to unsigned
int.
(end_ifcvt_sequence): Call set_used_flags on each insn in the
sequence.
Include rtl-iter.h.
(noce_simple_bbs): New function.
(noce_try_move): Bail if basic blocks are not simple.
(noce_try_store_flag): Likewise.
(noce_try_store_flag_constants): Likewise.
(noce_try_addcc): Likewise.
(noce_try_store_flag_mask): Likewise.
(noce_try_cmove): Likewise.
(noce_try_minmax): Likewise.
(noce_try_abs): Likewise.
(noce_try_sign_mask): Likewise.
(noce_try_bitop): Likewise.
(bbs_ok_for_cmove_arith): New function.
(noce_emit_all_but_last): Likewise.
(noce_emit_insn): Likewise.
(noce_emit_bb): Likewise.
(noce_try_cmove_arith): Handle non-simple basic blocks.
(insn_valid_noce_process_p): New function.
(contains_mem_rtx_p): Likewise.
(bb_valid_for_noce_process_p): Likewise.
(noce_process_if_block): Allow non-simple basic blocks
where appropriate.

* gcc.dg/ifcvt-1.c: New test.
* gcc.dg/ifcvt-2.c: Likewise.
* gcc.dg/ifcvt-3.c: Likewise.

From-SVN: r227368
gcc/ChangeLog
gcc/ifcvt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ifcvt-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/ifcvt-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/ifcvt-3.c [new file with mode: 0644]