This is the mail archive of the
mailing list for the GCC project.
Re: Fwd: [PATCH] Scheduling result adjustment to enable macro-fusion
- From: Wei Mi <wmi at google dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Jan Hubicka <hubicka at ucw dot cz>, Alexander Monakov <amonakov at ispras dot ru>, Steven Bosscher <stevenb dot gcc at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, David Li <davidxl at google dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Vladimir Makarov <vmakarov at redhat dot com>
- Date: Tue, 26 Nov 2013 22:55:12 -0800
- Subject: Re: Fwd: [PATCH] Scheduling result adjustment to enable macro-fusion
- Authentication-results: sourceware.org; auth=none
- References: <CA+4CFy7TCbnm3irCTKYuQmsz_xPNbC3YmugHC6fjiewPcREzZA at mail dot gmail dot com> <CA+4CFy6vGb__5DiT+jjYSSCpPCg0a+z2ueqg=0OQA9=E0=WrLw at mail dot gmail dot com> <525DA6FF dot 5010901 at redhat dot com> <CA+4CFy5qXcZz4CVshVjk8AwEu=B-Spctag+KSo+Ue5pgAvxR8Q at mail dot gmail dot com> <525EF180 dot 4020708 at redhat dot com> <CA+4CFy4CuW=U=GDYipxRjtBdszHqxaS_pK4NeJKeNWT+W75Veg at mail dot gmail dot com> <CA+4CFy5K--mRx6k_+Aro8-_ENp+ye3=7PqZQQ4ph6m7MpxW9JA at mail dot gmail dot com> <20131104011801 dot GB32134 at atrey dot karlin dot mff dot cuni dot cz> <CA+4CFy6j-sRhUBTpBOZ=50mnESiYBDG64FiC-71ybDYVyFpC7Q at mail dot gmail dot com> <CAMe9rOqdWFmiqEOrpRJT_YiyvvGmQx-M4qGACMEvV6khyMyc3A at mail dot gmail dot com> <CA+4CFy74eA6arbvph8G1zMAXzDURx_E4NbRdeQXkbRLsOHnvRg at mail dot gmail dot com> <52939894 dot 9020005 at redhat dot com> <CA+4CFy4eTkdzsh=xFukjduXXRvg6OWhMb9MOafBqEjWQEhSg9Q at mail dot gmail dot com> <5293A434 dot 4000305 at redhat dot com> <CA+4CFy5GURxpLevFbxhUm=CVZ2XO3i5iFA9DVQPx=gAcnPRQiA at mail dot gmail dot com> <5293CB63 dot 5070807 at redhat dot com> <CA+4CFy66B63dt8aKUKdpAS98sUnPphVMrTOOyhshuX+idBh__A at mail dot gmail dot com> <5295845E dot 9090505 at redhat dot com>
On Tue, Nov 26, 2013 at 9:34 PM, Jeff Law <firstname.lastname@example.org> wrote:
> On 11/26/13 12:33, Wei Mi wrote:
>> On Mon, Nov 25, 2013 at 2:12 PM, Jeff Law <email@example.com> wrote:
>>>> Doing the cleanup at the end of BB could ensure all the groups
>>>> inserted for macrofusion will be cleaned. For groups not at the end of
>>>> a block, no matter whether they are cleaned up or not, nothing will
>>>> happen because other passes will not mess up those groups -- you said
>>>> cc0-setter/cc0-user was such a case. Is it call group a different
>>> True, it would be safe, but it seems inconsistent and confusing that some
>>> SCHED_GROUP_P references would be purged and others remain.
>>> Given SCHED_GROUP_P is to used strictly in the scheduler ISTM that we
>>> be wiping it as we leave and that our RTL checkers ought to be verifying
>>> there are no insns with SCHED_GROUP_P left on.
>> How about add a verifier TODO_verify_sched_group_flag similar as
>> TODO_verify_rtl_sharing, and add the verifier in the todo lists of all
>> the scheduling passes.
>>>> For sched1 and sched2, we can do that. Actually, I find it has been
>>>> done in move_insn when commit_schedule. But for modulo scheduling, I
>>>> havn't found a good place to do it.
>>> Well, that's where I'd suggest focusing attention.
>> After looking it carefully, even for sched1 and sched2, it is not ok
>> to depend on move_insn in commit_schedule to clean up all the
>> SCHED_GROUP_P, suppose a block is decided not to be scheduled by
>> dbg_cnt, then SCHED_GROUP_P inside the block will not be cleaned.
>> It is even more difficult to find a place inside SMS scheduling to do
>> the cleanup.
>> Any suggestions?
> 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 ();
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...