From: "Bin.Cheng" <amker.cheng@gmail.com>
To: Kyrill Tkachov <kyrylo.tkachov@arm.com>
Cc: Jeff Law <law@redhat.com>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][expmed] Calculate mult-by-const cost properly in mult_by_coeff_cost
Date: Wed, 18 Mar 2015 09:36:00 -0000 [thread overview]
Message-ID: <CAHFci29UCMC88ocjGXwQjFo_4mCDTuT8r0DcWgMKRkW1n8k9GA@mail.gmail.com> (raw)
In-Reply-To: <55094024.8040201@arm.com>
On Wed, Mar 18, 2015 at 5:06 PM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
>
> On 17/03/15 19:11, Jeff Law wrote:
>>
>> On 03/16/2015 04:12 AM, Kyrill Tkachov wrote:
>>>
>>> Hi all,
>>>
>>> Eyeballing the mult_by_coeff_cost function I think it has a typo/bug.
>>> It's supposed to return the cost of multiplying by a constant 'coeff'.
>>> It calculates that by taking the cost of a MULT rtx by that constant
>>> and comparing it to the cost of synthesizing that multiplication, and
>>> returning
>>> the cheapest. However, in the MULT rtx cost calculations it creates
>>> a MULT rtx of two REGs rather than the a REG and the GEN_INT of coeff as
>>> I would
>>> expect. This patches fixes that in the obvious way.
>>>
>>> Tested aarch64-none-elf and bootstrapped on x86_64-linux-gnu.
>>> I'm guessing this is stage 1 material at this point?
>>>
>>> Thanks,
>>> Kyrill
>>>
>>> 2015-03-13 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>>>
>>> * expmed.c (mult_by_coeff_cost): Pass CONT_INT rtx to MULT cost
>>> calculation rather than fake_reg.
>>
>> I'd think stage1, unless you can point to a bug, particularly a
>> regression.
>
>
> No regression that I know of. I'll queue it up for stage 1 if it's ok
> code-wise.
This function just estimate the max_cost roughly, since it is only
used by Tree passes. It shouldn't have much impact on generated code.
Maybe some targets doesn't have proper cost function for reg * const
rtl expression, also most of calls are in IVOPT, so it would be better
if you run some benchmark to make sure there is no surprise.
Thanks,
bin
>
> Thanks,
> Kyrill
>
>> Jeff
>>
>
>
next prev parent reply other threads:[~2015-03-18 9:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-16 10:13 Kyrill Tkachov
2015-03-17 19:11 ` Jeff Law
2015-03-18 9:06 ` Kyrill Tkachov
2015-03-18 9:36 ` Bin.Cheng [this message]
2015-03-18 9:39 ` Kyrill Tkachov
2015-04-13 18:18 ` Jeff Law
2015-04-14 8:07 ` Kyrill Tkachov
2015-04-15 15:42 ` Jeff Law
2015-04-15 15:47 ` Kyrill Tkachov
2015-04-20 9:28 ` Kyrill Tkachov
2015-04-20 17:51 ` Jeff Law
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=CAHFci29UCMC88ocjGXwQjFo_4mCDTuT8r0DcWgMKRkW1n8k9GA@mail.gmail.com \
--to=amker.cheng@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=kyrylo.tkachov@arm.com \
--cc=law@redhat.com \
/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).