This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fwd: [PATCH] Scheduling result adjustment to enable macro-fusion
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: Wei Mi <wmi at google dot com>
- Cc: 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>
- Date: Wed, 11 Sep 2013 20:41:43 +0400 (MSK)
- Subject: Re: Fwd: [PATCH] Scheduling result adjustment to enable macro-fusion
- Authentication-results: sourceware.org; auth=none
- References: <CA+4CFy60EZ99xBGecerYLM9wD6w2v60SpJsfOGguA_PWLLupsA at mail dot gmail dot com> <CA+4CFy6+1ieFJ5+vvsStYs8AnfUY+aAVrYR-p-T7iPisVLCWHQ at mail dot gmail dot com> <alpine dot LNX dot 2 dot 00 dot 1309041253370 dot 5281 at monopod dot intra dot ispras dot ru> <CABu31nONs_DJ99YXDyWAE2a5iyoQWQyuGwLm0jrcb+mCx2M1Aw at mail dot gmail dot com> <CABtfrpCU1jkTZvA-cZ99bjhBnvQMTkNxHMDhhmkAa_k891T1zw at mail dot gmail dot com> <CA+4CFy5A2Nk-yUfQNZYQQd+O93mcJYBVty9S_5sd9VFinxmYdg at mail dot gmail dot com> <CA+4CFy4M8ckX3g8xCQEV+g4SdWgy742oBiGSep4GM74q3paVzA at mail dot gmail dot com> <alpine dot LNX dot 2 dot 00 dot 1309101543040 dot 2373 at monopod dot intra dot ispras dot ru> <CA+4CFy6nqWvmYsFSbPtQqX3MJvXFpMv3fMGXhr1-F05Qz42f8Q at mail dot gmail dot com> <alpine dot LNX dot 2 dot 00 dot 1309111358041 dot 2373 at monopod dot intra dot ispras dot ru> <CA+4CFy7Jsq_k65Nj63HA013KYuExkvtQcEKbVsMszyqVNtHC_Q at mail dot gmail dot com>
On Wed, 11 Sep 2013, Wei Mi wrote:
> I tried that and it caused some regressions, so I choosed to do
> chain_to_prev_insn another time in add_branch_dependences. There could
> be some dependence between those two functions.
(please don't top-post on this list)
In that case you can adjust 'last' in add_branch_dependences so that the
dependences pin the compare rather than the jump to the end, like this
(untested):
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 2c971e2..a774d5d 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -2443,6 +2443,9 @@ add_branch_dependences (rtx head, rtx tail)
cc0 setters remain at the end because they can't be moved away from
their cc0 user.
+ Predecessors of SCHED_GROUP_P instructions that remain at the end also
+ remain at the end.
+
COND_EXEC insns cannot be moved past a branch (see e.g. PR17808).
Insns setting TARGET_CLASS_LIKELY_SPILLED_P registers (usually return
@@ -2465,6 +2468,7 @@ add_branch_dependences (rtx head, rtx tail)
#endif
|| (!reload_completed
&& sets_likely_spilled (PATTERN (insn)))))
+ || (last != 0 && SCHED_GROUP_P (last))
|| NOTE_P (insn))
{
if (!NOTE_P (insn))
I'm also not a fan of adding two scheduler hooks and explicit handling in
sched-deps.c for this feature. You probably could handle that with sched_init
hook entirely in the x86 backend (just loop over basic blocks and mark
suitable jumps with SCHED_GROUP_P), but on the other hand I can see an
argument that this might be useful in the future for other architectures.
Have you considered that? What do other maintainers say?
Thanks.
Alexander