From: HAO CHEN GUI <guihaoc@linux.ibm.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
Segher Boessenkool <segher@kernel.crashing.org>,
David <dje.gcc@gmail.com>, "Kewen.Lin" <linkw@linux.ibm.com>,
Peter Bergner <bergner@linux.ibm.com>,
Jeff Law <jeffreyalaw@gmail.com>
Subject: Re: [PATCH] rtlanal: Correct cost regularization in pattern_cost
Date: Fri, 10 May 2024 16:50:10 +0800 [thread overview]
Message-ID: <e812d409-14f1-4555-90f7-a6ebd9355ede@linux.ibm.com> (raw)
In-Reply-To: <CAFiYyc32LeXt03f9cAkByYTexNjnyYDbDGt5gRxZf-S2n76rrQ@mail.gmail.com>
Hi Richard,
Thanks for your comments.
在 2024/5/10 15:16, Richard Biener 写道:
> But if targets return sth < COSTS_N_INSNS (1) but > 0 this is now no
> longer meaningful. So shouldn't it instead be
>
> return cost > 0 ? cost : 1;
Yes, it's better.
>
> ? Alternatively returning fractions of COSTS_N_INSNS (1) from set_src_cost
> is invalid and thus the target is at fault (I do think that making zero the
> unknown value is quite bad since that makes it impossible to have zero
> as cost represented).
>
> It seems the check is to aovid pattern_cost return zero (unknown), so the
> comment holds to pattern_cost the same (it returns an 'int' so the better
> exceptional value would have been -1, avoiding the compare).
But sometime it adds an insn cost. If the unknown cost is -1, the total cost
might be distorted.
>
> Richard.
Thanks
Gui Haochen
next prev parent reply other threads:[~2024-05-10 12:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-10 2:25 HAO CHEN GUI
2024-05-10 7:16 ` Richard Biener
2024-05-10 8:50 ` HAO CHEN GUI [this message]
2024-05-10 9:04 ` Segher Boessenkool
2024-05-10 10:19 ` Richard Biener
2024-05-10 10:52 ` Segher Boessenkool
2024-05-10 12:50 ` Richard Biener
2024-05-10 14:34 ` Segher Boessenkool
2024-05-14 7:40 ` HAO CHEN GUI
2024-05-10 9:01 ` Segher Boessenkool
2024-06-12 16:49 ` Richard Sandiford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e812d409-14f1-4555-90f7-a6ebd9355ede@linux.ibm.com \
--to=guihaoc@linux.ibm.com \
--cc=bergner@linux.ibm.com \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@gmail.com \
--cc=linkw@linux.ibm.com \
--cc=richard.guenther@gmail.com \
--cc=segher@kernel.crashing.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).