This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFC: Patch 6/6] Remove second cost model from noce_try_store_flag_mask
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: <nd at arm dot com>, <ramana dot radhakrishnan at arm dot com>, <bernds_cb1 at t-online dot de>, <law at redhat dot com>, <ebotcazou at libertysurf dot fr>, <steven at gcc dot gnu dot org>
- Date: Thu, 2 Jun 2016 17:53:58 +0100
- Subject: [RFC: Patch 6/6] Remove second cost model from noce_try_store_flag_mask
- Authentication-results: sourceware.org; auth=none
- Nodisclaimer: True
- References: <5617A4DE dot 6020004 at redhat dot com> <1464886438-17892-1-git-send-email-james dot greenhalgh at arm dot com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
Hi,
This transformation tries two cost models, one estimating the number
of insns to use, one estimating the RTX cost of the transformed sequence.
This is inconsistent with the other cost models used in ifcvt.c and
unnecessary - eliminate the second cost model.
Thanks,
James
---
2016-06-02 James Greenhalgh <james.greenhalgh@arm.com>
* ifcvt.c (noce_try_store_flag_mask): Delete redundant cost model.
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index f71889e..6e9997e 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -1670,8 +1670,8 @@ noce_try_store_flag_mask (struct noce_if_info *if_info)
reversep = 0;
- /* Two insns, AND, NEG. */
- if ((noce_estimate_conversion_profitable_p (if_info, 2)
+ /* One insn, AND. */
+ if ((noce_estimate_conversion_profitable_p (if_info, 1)
|| STORE_FLAG_VALUE == -1)
&& ((if_info->a == const0_rtx
&& rtx_equal_p (if_info->b, if_info->x))
@@ -1693,9 +1693,6 @@ noce_try_store_flag_mask (struct noce_if_info *if_info)
if (target)
{
- int old_cost, new_cost, insn_cost;
- int speed_p;
-
if (target != if_info->x)
noce_emit_move_insn (if_info->x, target);
@@ -1703,15 +1700,6 @@ noce_try_store_flag_mask (struct noce_if_info *if_info)
if (!seq)
return FALSE;
- speed_p = optimize_bb_for_speed_p (BLOCK_FOR_INSN (if_info->insn_a));
- insn_cost = insn_rtx_cost (PATTERN (if_info->insn_a), speed_p);
- /* TODO: Revisit this cost model. */
- old_cost = if_info->rtx_edge_cost + insn_cost;
- new_cost = seq_cost (seq, speed_p);
-
- if (new_cost > old_cost)
- return FALSE;
-
emit_insn_before_setloc (seq, if_info->jump,
INSN_LOCATION (if_info->insn_a));
return TRUE;