答复: How about providing an interface to fusing instructions via scheduling

2021-09-06 Thread gengqi via Gcc
In fact, I had read the relevant code of aarch64 before suggesting this
point.

As I understood it, the interface could set the priority based on the
properties of the insn itself. The insn of the load/store instructions have
the same properties, and using these similarities it could be scheduled
together.
But the instructions that I want to pair together are not like this, their
insn's may not have the same properties. And if I want to schedule the
instructions to be fused together, I have to consider the instructions that
might be laid out before and after them.

So my requirements are not matched by the functionality provided by this
interface. I don't think it is a good choice to implement my requirements
with this interface.

-邮件原件-
发件人: Kyrylo Tkachov [mailto:kyrylo.tkac...@arm.com] 
发送时间: 2021年9月3日 19:11
收件人: gengqi 
抄送: gcc@gcc.gnu.org
主题: RE: How about providing an interface to fusing instructions via
scheduling

Hi,

> -Original Message-
> From: Gcc  On Behalf 
> Of gengqi via Gcc
> Sent: 03 September 2021 11:56
> To: gcc@gcc.gnu.org
> Subject: How about providing an interface to fusing instructions via 
> scheduling
> 
> When I was adding pipeline to my backend, some instructions needed to 
> be fused and I found that there was no suitable interface to implement 
> my requirements.
> 
> 
> 
> My hope is that
> 
> 1. Do instruction scheduling and combine any two instructions, and 
> sometimes the two instructions can be treated as 1 when they are 
> issued
> 
> 2. The two instructions only work better when they are immediately 
> adjacent to each other
> 
> 3. An instruction can only be fused once, i.e. if the current 
> instruction has been fused with the previous one, the next one cannot 
> be fused with the current one.
> 
> 
> 
> I have referred to numerous interfaces in the “GCC INTERNALS” which 
> implement some of my requirements, but all of which just happen not to 
> cover my needs completely.

Indeed, there are a few places in GCC that help, but not a clean catch-all
solution.

> 
> 
> 
> These interfaces are:
> 
> -  bool TARGET_SCHED_MACRO_FUSION_PAIR_P (rtx insn *prev, rtx insn
> *curr)
> 
> The name of the interface looks a lot like what I need. But in reality 
> I found that this interface only fuses instructions that are already 
> adjacent to each other and does not do scheduling (not satisfy 1). And 
> this interface may fuse 3 or more instructions (not satisfy 3).

Indeed, this interface ensures that instructions that are already adjacent
are kept together, but doesn't bring them together from far away.

> 
> 
> 
> -  void TARGET_SCHED_FUSION_PRIORITY (rtx insn *insn, int max_pri, int
> *fusion_pri, int *pri)
> 
> This interface is very powerful, but with only one insn being 
> processed at a time, this interface does not seem to be suitable for 
> context sensitive situations.
> 

This is likely more appropriate for your needs. You may want to look in the
implementation of this (and related) hook in the aarch64 backend.
We use it there to bring certain loads and stores together with the intent
to form special load/store-pair instructions.
The scheduler brings them insns together, but we rely on post-scheduling
peepholes to actually combine the two together into a single instruction.
Although there are a few cases where it misses opportunities, it works
pretty well.

Thanks,
Kyrill

> 
> 
> -  Use (define_bypass number out_insn_names in_insn_names [guard])
> 
> The “bypass” does not guarantee that the instruction being dispatched 
> is immediately adjacent to (not satisfy 2). Moreover, bypass only 
> handles instructions with true dependence.
> 
> 
> 
> -  int TARGET_SCHED_REORDER (FILE *file, int verbose, rtx insn
**ready,
> int *n_readyp, int clock) and TARGET_SCHED_REORDER2()
> 
> This interface allows free adjustment of ready instructions, but it is 
> not eay to get the last scheduled instruction. The last scheduled 
> instruction needs to be taken into account for fusion.
> 
> 
> 
> -  Use define_peephole2
> 
> Since the fused instructions are somehow identical to one instruction, 
> it is thought that a peephole might be a good choice. But
“define_peephole2”
> also does not schedule instructions.
> 
> 
> 
> In summary, I have not found an interface that does both scheduling 
> and fusion. Maybe we should enhance one of the above interfaces, or 
> maybe we should provide a new one. I think it is necessary and 
> beneficial to have an interface that does both scheduling and fusion.



Re: Enable the vectorizer at -O2 for GCC 12

2021-09-06 Thread Hongtao Liu via Gcc
On Wed, Sep 1, 2021 at 7:24 PM Tamar Christina via Gcc  wrote:
>
> -- edit, added list back in --
>
> Just to add some AArch64 numbers for Spec2017 we see 2.1% overall Geomean 
> improvements (all from x264 as expected) with no real regressions (everything 
> within variance) and only a 0.06% binary size increase overall (of which x264 
> grew 0.15%) using the very cheap cost model.
>
> So we'd be quite keen on this as well.
>
> Cheers,
> Tamar
>
> > -Original Message-
> > From: Gcc  On Behalf
> > Of Florian Weimer via Gcc
> > Sent: Monday, August 30, 2021 2:05 PM
> > To: gcc@gcc.gnu.org
> > Cc: ja...@redhat.com; Richard Earnshaw ;
> > Segher Boessenkool ; Richard Sandiford
> > ; premachandra.malla...@amd.com;
> > Hongtao Liu 
> > Subject: Enable the vectorizer at -O2 for GCC 12
> >
> > There has been a discussion, both off-list and on the gcc-help mailing list
> > (“Why vectorization didn't turn on by -O2”, spread across several months),
> > about enabling the auto-vectorizer at -O2, similar to what Clang does.
> >
> > I think the review concluded that the very cheap cost model should be used
> > for that.
> >
> > Are there any remaining blockers?
> >
> > Thanks,
> > Florian
>

A patch is posted at [1] to enable auto-vectorization at O2 w/
very-cheap cost mode.

[1] https://gcc.gnu.org/pipermail/gcc-patches/2021-September/578877.html

-- 
BR,
Hongtao


Delivery report

2021-09-06 Thread postmaster
Hello, this is the mail server on mta0.connevate.com.

I am sending you this message to inform you on the delivery status of a
message you previously sent.  Immediately below you will find a list of
the affected recipients;  also attached is a Delivery Status Notification
(DSN) report in standard format, as well as the headers of the original
message.

delivery failed; will not continue trying
Reporting-MTA: dns;mta0.connevate.com
X-PowerMTA-VirtualMTA: pmta-vmta0
Received-From-MTA: dns;test.com (45.154.4.41)
Arrival-Date: Mon, 6 Sep 2021 07:38:39 -0500

Final-Recipient: rfc822;gcc@gcc.gnu.org
Action: failed
Status: 5.7.1 (delivery not authorized)
Remote-MTA: dns;gcc.gnu.org (8.43.85.97)
Diagnostic-Code: smtp;550 5.7.1 Blocked by SpamAssassin
X-PowerMTA-BounceCategory: spam-related
From: gcc 
To: gcc@gcc.gnu.org
Subject: Fw: Quote_request
Date: 06 Sep 2021 05:38:39 -0700
Message-ID: <20210906053839.72fd0c0ce9eed...@gcc.gnu.org>
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="=_NextPart_000_0012_1C381DB8.246FE33B"


Build gcc question

2021-09-06 Thread Gary Oblock via Gcc
I've got a really amazingly bizarre bug, when running my modified
gcc under gdb, I see some bewildering behavior. So, before I start
debugging at the assembly level, I'd like to see some .s files.
This led me to try adding "-save-temps" to the CFLAGS and
CXXFLAGS on the make command line. This in turn led to plethora
of different assembly errors. Is this supposed to happen
and is there another way to preserve .s files?

Thanks,

Gary


CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for 
the sole use of the intended recipient(s) and contains information that is 
confidential and proprietary to Ampere Computing or its subsidiaries. It is to 
be used solely for the purpose of furthering the parties' business 
relationship. Any unauthorized review, copying, or distribution of this email 
(or any attachments thereto) is strictly prohibited. If you are not the 
intended recipient, please contact the sender immediately and permanently 
delete the original and any copies of this email and any attachments thereto.