On 04/26/2017 06:50 AM, Hurugalawadi, Naveen wrote:
Hi Wilco,
Thanks for reviewing the patch.
The return false seems incorrect - it means a core can either have
FUSE_CMP_BRANCH or FUSE_ALU_BRANCH but not both.
Thanks for pointing out about the confusion.
Modified the code as required.
Bootstrapped and Regression tested on AArch64 and X86_64.
Please review the patch and let us know if its okay?
Thanks,
Naveen
fusion-anycond-jump-1.patch
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index b2393bf..b15a865 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -2835,33 +2835,16 @@ sched_macro_fuse_insns (rtx_insn *insn)
{
rtx_insn *prev;
- if (any_condjump_p (insn))
- {
- unsigned int condreg1, condreg2;
- rtx cc_reg_1;
- targetm.fixed_condition_code_regs (&condreg1, &condreg2);
- cc_reg_1 = gen_rtx_REG (CCmode, condreg1);
- prev = prev_nonnote_nondebug_insn (insn);
- if (!reg_referenced_p (cc_reg_1, PATTERN (insn))
- || !prev
- || !modified_in_p (cc_reg_1, prev))
- return;
- }
- else
- {
- rtx insn_set = single_set (insn);
-
- prev = prev_nonnote_nondebug_insn (insn);
- if (!prev
- || !insn_set
- || !single_set (prev))
- return;
+ rtx insn_set = single_set (insn);
- }
+ prev = prev_nonnote_nondebug_insn (insn);
+ if (!prev
+ || !insn_set
+ || !single_set (prev))
+ return;
if (targetm.sched.macro_fusion_pair_p (prev, insn))
SCHED_GROUP_P (insn) = 1;
-
}
Doesn't this avoid calling the target hook in cases where it used to
call it before?
Consider a conditional jump inside a parallel that is not a single set.
Previously that could call the target hook and potentially set
SCHED_GROUP_P. But after your change I think it would return without
ever querying the backend.
jeff