Commit 509f819a by Naveen H.S Committed by Naveen H.S

aarch64.c (aarch_macro_fusion_pair_p): Push the check for CC usage into AARCH64_FUSE_CMP_BRANCH.

2017-06-29  Naveen H.S  <Naveen.Hurugalawadi@cavium.com>

	* config/aarch64/aarch64.c (aarch_macro_fusion_pair_p): Push the
	check for CC usage into AARCH64_FUSE_CMP_BRANCH.
	* config/i386/i386.c (ix86_macro_fusion_pair_p): Push the check for
	CC usage from generic code to here.
	* sched-deps.c (sched_macro_fuse_insns): Move the condition for
	CC usage into the target macros.

From-SVN: r249827
parent 44b222ce
2017-06-29 Naveen H.S <Naveen.Hurugalawadi@cavium.com>
* config/aarch64/aarch64.c (aarch_macro_fusion_pair_p): Push the
check for CC usage into AARCH64_FUSE_CMP_BRANCH.
* config/i386/i386.c (ix86_macro_fusion_pair_p): Push the check for
CC usage from generic code to here.
* sched-deps.c (sched_macro_fuse_insns): Move the condition for
CC usage into the target macros.
2017-06-29 Maya Rashish <coypu@sdf.org> 2017-06-29 Maya Rashish <coypu@sdf.org>
* config/netbsd.h (NETBSD_LIB_SPEC): Add -lc when creating shared * config/netbsd.h (NETBSD_LIB_SPEC): Add -lc when creating shared
......
...@@ -14304,6 +14304,15 @@ aarch_macro_fusion_pair_p (rtx_insn *prev, rtx_insn *curr) ...@@ -14304,6 +14304,15 @@ aarch_macro_fusion_pair_p (rtx_insn *prev, rtx_insn *curr)
{ {
enum attr_type prev_type = get_attr_type (prev); enum attr_type prev_type = get_attr_type (prev);
unsigned int condreg1, condreg2;
rtx cc_reg_1;
aarch64_fixed_condition_code_regs (&condreg1, &condreg2);
cc_reg_1 = gen_rtx_REG (CCmode, condreg1);
if (reg_referenced_p (cc_reg_1, PATTERN (curr))
&& prev
&& modified_in_p (cc_reg_1, prev))
{
/* FIXME: this misses some which is considered simple arthematic /* FIXME: this misses some which is considered simple arthematic
instructions for ThunderX. Simple shifts are missed here. */ instructions for ThunderX. Simple shifts are missed here. */
if (prev_type == TYPE_ALUS_SREG if (prev_type == TYPE_ALUS_SREG
...@@ -14312,6 +14321,7 @@ aarch_macro_fusion_pair_p (rtx_insn *prev, rtx_insn *curr) ...@@ -14312,6 +14321,7 @@ aarch_macro_fusion_pair_p (rtx_insn *prev, rtx_insn *curr)
|| prev_type == TYPE_LOGICS_IMM) || prev_type == TYPE_LOGICS_IMM)
return true; return true;
} }
}
return false; return false;
} }
......
...@@ -30345,6 +30345,15 @@ ix86_macro_fusion_pair_p (rtx_insn *condgen, rtx_insn *condjmp) ...@@ -30345,6 +30345,15 @@ ix86_macro_fusion_pair_p (rtx_insn *condgen, rtx_insn *condjmp)
if (!any_condjump_p (condjmp)) if (!any_condjump_p (condjmp))
return false; return false;
unsigned int condreg1, condreg2;
rtx cc_reg_1;
ix86_fixed_condition_code_regs (&condreg1, &condreg2);
cc_reg_1 = gen_rtx_REG (CCmode, condreg1);
if (!reg_referenced_p (cc_reg_1, PATTERN (condjmp))
|| !condgen
|| !modified_in_p (cc_reg_1, condgen))
return false;
if (get_attr_type (condgen) != TYPE_TEST if (get_attr_type (condgen) != TYPE_TEST
&& get_attr_type (condgen) != TYPE_ICMP && get_attr_type (condgen) != TYPE_ICMP
&& get_attr_type (condgen) != TYPE_INCDEC && get_attr_type (condgen) != TYPE_INCDEC
...@@ -2834,6 +2834,9 @@ static void ...@@ -2834,6 +2834,9 @@ static void
sched_macro_fuse_insns (rtx_insn *insn) sched_macro_fuse_insns (rtx_insn *insn)
{ {
rtx_insn *prev; rtx_insn *prev;
prev = prev_nonnote_nondebug_insn (insn);
if (!prev)
return;
if (any_condjump_p (insn)) if (any_condjump_p (insn))
{ {
...@@ -2841,27 +2844,20 @@ sched_macro_fuse_insns (rtx_insn *insn) ...@@ -2841,27 +2844,20 @@ sched_macro_fuse_insns (rtx_insn *insn)
rtx cc_reg_1; rtx cc_reg_1;
targetm.fixed_condition_code_regs (&condreg1, &condreg2); targetm.fixed_condition_code_regs (&condreg1, &condreg2);
cc_reg_1 = gen_rtx_REG (CCmode, condreg1); cc_reg_1 = gen_rtx_REG (CCmode, condreg1);
prev = prev_nonnote_nondebug_insn (insn); if (reg_referenced_p (cc_reg_1, PATTERN (insn))
if (!reg_referenced_p (cc_reg_1, PATTERN (insn)) && modified_in_p (cc_reg_1, prev))
|| !prev
|| !modified_in_p (cc_reg_1, prev))
return;
}
else
{ {
rtx insn_set = single_set (insn); if (targetm.sched.macro_fusion_pair_p (prev, insn))
SCHED_GROUP_P (insn) = 1;
prev = prev_nonnote_nondebug_insn (insn);
if (!prev
|| !insn_set
|| !single_set (prev))
return; return;
}
} }
if (single_set (insn) && single_set (prev))
{
if (targetm.sched.macro_fusion_pair_p (prev, insn)) if (targetm.sched.macro_fusion_pair_p (prev, insn))
SCHED_GROUP_P (insn) = 1; SCHED_GROUP_P (insn) = 1;
}
} }
/* Get the implicit reg pending clobbers for INSN and save them in TEMP. */ /* Get the implicit reg pending clobbers for INSN and save them in TEMP. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment