This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: TARGET_MACRO_FUSION_PAIR for something besides compare-and-branch ?

On 28/05/14 17:36, Alexander Monakov wrote:

On Wed, 28 May 2014, Kyrill Tkachov wrote:

Hi all,

The documentation for TARGET_MACRO_FUSION_PAIR says that it can be used to
tell the scheduler that two insns should not be scheduled apart. It doesn't
specify what kinds of insns those can be.

Yet from what I can see in sched-deps.c it can only be used on compares and
conditional branches, as implemented in i386.
Please note that it's not only restricted to conditional branches, but also to
keeping the instructions together if they were consecutive in the first place
(i.e. it does not try to move a compare insn closer to the branch).

Doing it that way allowed to solve the issue at hand at that time without a
separate scan of the whole RTL instruction stream.
Say I want to specify two other types of instruction that I want to force
together, would it be worth generalising the TARGET_MACRO_FUSION_PAIR usage
to achieve that?
Hi Alexander,
Thanks for the insight,

I'd say yes, but that would be the least of the problems; the more important
question is how to trigger the hook (you probably want to integrate it into
the existing scheduler dependencies evaluation loop rather than adding a new
loop just to discover macro-fusable pairs).

Yeah, I was afraid that would be the case.

  You'll also have to invent
something new if you want to move non-consecutive fusable insns together if
they are apart.

Seems to me that TARGET_SCHED_REORDER would be a better fit for that.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]