This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH RFC]Pair load store instructions using a generic scheduling fusion pass
- From: "Bin.Cheng" <amker dot cheng at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Mike Stump <mikestump at comcast dot net>, Richard Biener <richard dot guenther at gmail dot com>, Bin Cheng <bin dot cheng at arm dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>, Richard Earnshaw <rearnsha at arm dot com>
- Date: Wed, 8 Oct 2014 13:52:18 +0800
- Subject: Re: [PATCH RFC]Pair load store instructions using a generic scheduling fusion pass
- Authentication-results: sourceware.org; auth=none
- References: <000001cfdc90$1d95c670$58c15350$ at arm dot com> <781A4573-F7ED-4ABD-B222-76F2044E641A at comcast dot net> <CAHFci29=8H_qQSCwUUMWgdyX-DQziE8hSagM7CDNBEMkrXo+3w at mail dot gmail dot com> <CAFiYyc14oz1x309XF08hZHN1UbfuP9PxMQH0x5V5GBDePN4Cvw at mail dot gmail dot com> <6EBE944B-D1A5-4DF5-A2EC-9927690AB7B0 at comcast dot net> <CAHFci2-nbyc_GNt08EcA_7bPzW12YtrdgoeArF0-kcX861ZW9Q at mail dot gmail dot com> <5434CB79 dot 3010100 at redhat dot com>
On Wed, Oct 8, 2014 at 1:28 PM, Jeff Law <law@redhat.com> wrote:
> On 10/06/14 19:31, Bin.Cheng wrote:
>>
>> On Tue, Oct 7, 2014 at 1:20 AM, Mike Stump <mikestump@comcast.net> wrote:
>>>
>>> On Oct 6, 2014, at 4:32 AM, Richard Biener <richard.guenther@gmail.com>
>>> wrote:
>>>>
>>>> On Mon, Oct 6, 2014 at 11:57 AM, Bin.Cheng <amker.cheng@gmail.com>
>>>> wrote:
>>>>
>>>> How many merging opportunities does sched2 undo again? ISTR it
>>>> has the tendency of pushing stores down and loads up.
>>>
>>>
>>> So, the pass works by merging 2 or more loads into 1 load (at least on my
>>> port). sched2 would need to rip apart 1 load into 2 loads to be able to
>>> undo the real work. The non-real work, doesn't matter any. Can sched2 rip
>>> apart a single load?
>>
>> On ARM and AARCH64, the two merged load/store are transformed into
>> single parallel insn by the following peephole2 pass, so that sched2
>> would not undo the fusion work. I though sched2 works on the basis of
>> instructions, and it isn't good practice to have sched2 do split work.
>
> It's certainly advantageous for sched2 to split insns that generate multiple
> instructions. Running after register allocation, sched2 is ideal for
> splitting because the we know the alternative for each insn and thus we can
> (possibly for the first time) accurately know if a particular insn will
> generate multiple assembly instructions.
>
> If the port has a splitter to rip apart a douple-word load into single-word
> loads, then we'd obviously only want to do that in cases where the
> double-word load actually generates > 1 assembly instruction.
>
> Addressing issues in that space seems out of scope for Bin's work to me,
> except perhaps for such issues on aarch64/arm which are Bin's primary
> concerns.
Hi Jeff,
Thanks very much for the explanation. Very likely I am wrong here,
but seems what you mentioned fits to pass_split_before_sched2 very
well. Then I guess it would be nice if we can differentiate cases in
the first place by generating different patterns, rather than split
some of instructions later. Though I have no idea if we can do that
or not.
For arm/aarch64, I guess it's not an issue, otherwise the peephole2
won't work at all. ARM maintainers should have answer to this.
>
> jeff