From: Kyrylo Tkachov <[email protected]>
cond_exec_find_if_block stores ce_info->last_test_bb on entry and again, with
the same value, once it has found an && or || block. Drop the second store.
The rest are spelling changes: an elaborated struct type and a stray space in
two signatures, a pointer compared against NULL_RTX, a bool passed for an int
normalize argument, and an index loop that reads better as a range-for.
gcc/ChangeLog:
* ifcvt.cc (noce_try_store_flag_logical): Pass 0, not false, for the
normalize argument.
(noce_convert_multiple_sets): Use a range-for over insn_info.
(merge_if_block, cond_exec_find_if_block): Drop the elaborated struct
type.
(block_jumps_and_fallthru): Test the insn pointer directly.
(cond_exec_find_if_block): Drop a redundant last_test_bb store.
Signed-off-by: Kyrylo Tkachov <[email protected]>
---
gcc/ifcvt.cc | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc
index fb3f507758a..fd935ed6e19 100644
--- a/gcc/ifcvt.cc
+++ b/gcc/ifcvt.cc
@@ -2133,7 +2133,7 @@ noce_try_store_flag_logical (struct noce_if_info *if_info)
adjust its value (if necessary) to -1/0. */
start_sequence ();
rtx temp = gen_reg_rtx (mode);
- rtx target = noce_emit_store_flag (if_info, temp, !swapped, false);
+ rtx target = noce_emit_store_flag (if_info, temp, !swapped, 0);
if (!target)
{
end_sequence ();
@@ -4231,10 +4231,10 @@ noce_convert_multiple_sets (struct noce_if_info
*if_info)
set_used_flags (insn);
/* Mark all our temporaries and targets as used. */
- for (unsigned i = 0; i < insn_info.length (); i++)
+ for (const noce_multiple_sets_info *msi : insn_info)
{
- set_used_flags (insn_info[i]->temporary);
- set_used_flags (insn_info[i]->target);
+ set_used_flags (msi->temporary);
+ set_used_flags (msi->target);
}
set_used_flags (cond);
@@ -5604,7 +5604,7 @@ merge_block_into_combo (basic_block combo_bb, basic_block
bb)
/* Merge the blocks and mark for local life update. */
static void
-merge_if_block (struct ce_if_block * ce_info)
+merge_if_block (ce_if_block *ce_info)
{
basic_block test_bb = ce_info->test_bb; /* last test block */
basic_block then_bb = ce_info->then_bb; /* THEN */
@@ -5842,7 +5842,7 @@ block_jumps_and_fallthru (basic_block cur_bb, basic_block
target_bb)
end = BB_END (cur_bb);
insn = BB_HEAD (cur_bb);
- while (insn != NULL_RTX)
+ while (insn)
{
if (CALL_P (insn))
return -1;
@@ -5868,7 +5868,7 @@ block_jumps_and_fallthru (basic_block cur_bb, basic_block
target_bb)
Return TRUE if we were successful at converting the block. */
static bool
-cond_exec_find_if_block (struct ce_if_block * ce_info)
+cond_exec_find_if_block (ce_if_block *ce_info)
{
basic_block test_bb = ce_info->test_bb;
basic_block then_bb = ce_info->then_bb;
@@ -5914,8 +5914,6 @@ cond_exec_find_if_block (struct ce_if_block * ce_info)
int total_insns = 0;
int blocks = 0;
- ce_info->last_test_bb = test_bb;
-
/* Found at least one && or || block, look for more. */
do
{
--
2.50.1 (Apple Git-155)