On 11/27/13 15:31, Wei Mi wrote:
Hmm, maybe attack from the other direction? -- could we clear SCHED_GROUP_P
for each insn at the start of this loop in sched_analyze?
It's not as clean in the sense that SCHED_GROUP_P "escapes" the scheduler,
but it might be an option.
for (insn = head;; insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
{
/* And initialize deps_lists. */
sd_init_insn (insn);
}
deps_analyze_insn (deps, insn);
if (insn == tail)
{
if (sched_deps_info->use_cselib)
cselib_finish ();
return;
}
}
Jeff
Thanks for the suggestion. It looks workable. Then I need to move the
SCHED_GROUP_P setting for macrofusion from sched_init to a place
inside sched_analyze after the SCHED_GROUP_P cleanup. It will be more
consistent with the settings for cc0 setter-user group and call group,
which are both inside sched_analyze.
I am trying this method...
Thanks,
Wei.
Here is the patch. The patch does the SCHED_GROUP_P cleanup in
sched_analyze before deps_analyze_insn set SCHED_GROUP_P and chain the
insn with prev insns. And it move try_group_insn for macrofusion from
sched_init to sched_analyze_insn.
bootstrap and regression pass on x86_64-linux-gnu. Is it ok?
Thanks,
Wei.
2013-11-27 Wei Mi <w...@google.com>
PR rtl-optimization/59020
* sched-deps.c (try_group_insn): Move it from haifa-sched.c to here.
(sched_analyze_insn): Call try_group_insn.
(sched_analyze): Cleanup SCHED_GROUP_P before start the analysis.
* haifa-sched.c (try_group_insn): Moved to sched-deps.c.
(group_insns_for_macro_fusion): Removed.
(sched_init): Remove calling group_insns_for_macro_fusion.
2013-11-27 Wei Mi <w...@google.com>
PR rtl-optimization/59020
* testsuite/gcc.dg/pr59020.c: New.
* testsuite/gcc.dg/macro-fusion-1.c: New.
* testsuite/gcc.dg/macro-fusion-2.c: New.
This is fine. Thanks for your patience,
Jeff