From: Ramana Radhakrishnan <ramana.gcc@googlemail.com>
To: Zhenqiang Chen <zhenqiang.chen@linaro.org>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH, ARM] Keep constants in register when expanding
Date: Fri, 08 Aug 2014 15:22:00 -0000 [thread overview]
Message-ID: <CAJA7tRaHUngFY+=t8C0jaQmt-5uxFu4fEkAsj7u26Vp75x9PfA@mail.gmail.com> (raw)
In-Reply-To: <CACgzC7Bx7fSLmYysz=09D4yi+_QcfLo4BXK3gEGa8kmywE0_JQ@mail.gmail.com>
On Tue, Aug 5, 2014 at 10:31 AM, Zhenqiang Chen
<zhenqiang.chen@linaro.org> wrote:
> Hi,
>
> For some large constants, ARM will split them during expanding, which
> makes impossible to hoist them out the loop or shared by different
> references (refer the test case in the patch).
>
> The patch keeps some constants in registers. If the constant can not
> be optimized, the cprop and combine passes can optimize them as what
> we do in current expand pass with
>
> define_insn_and_split "*arm_subsi3_insn"
> define_insn_and_split "*arm_andsi3_insn"
> define_insn_and_split "*iorsi3_insn"
> define_insn_and_split "*arm_xorsi3"
>
> The patch does not modify addsi3 since the define_insn_and_split
> "*arm_addsi3" is only valid when (reload_completed ||
> !arm_eliminable_register (operands[1])). The cprop and combine passes
> can not optimize the large constant if we put it in register, which
> will lead to regression.
>
> For logic operators, the patch skips changes for constants:
>
> INTVAL (operands[2]) < 0 && const_ok_for_arm (-INTVAL (operands[2])
>
> since expand pass always uses "sign-extend" to get the value
> (trunc_int_for_mode called from immed_wide_int_const) for rtl, and
> logs show most negative values are UNSIGNED when they are TREE node.
> And combine pass is smart enough to recover the negative value to
> positive value.
I am unable to verify any change in code generation for this testcase
with and without the patch when I had a play with the patch.
what gives ?
Ramana
>
> Bootstrap and no make check regression on Chrome book.
> For coremark, dhrystone and eembcv1, no any code size and performance
> change on Cortex-M4.
> No any file in CSiBE has code size change for Cortex-A15 and Cortex-M4.
> No Spec2000 performance regression on Chrome book and dumped assemble
> codes only show very few difference.
>
> OK for trunk?
>
> Thanks!
> -Zhenqiang
>
> ChangeLog:
> 2014-08-05 Zhenqiang Chen <zhenqiang.chen@linaro.org>
>
> * config/arm/arm.md (subsi3, andsi3, iorsi3, xorsi3): Keep some
> large constants in register other than split them.
>
> testsuite/ChangeLog:
> 2014-08-05 Zhenqiang Chen <zhenqiang.chen@linaro.org>
>
> * gcc.target/arm/maskdata.c: New test.
next prev parent reply other threads:[~2014-08-08 15:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-05 9:31 Zhenqiang Chen
2014-08-08 15:22 ` Ramana Radhakrishnan [this message]
2014-08-11 2:35 ` Zhenqiang Chen
2014-08-11 11:15 ` Ramana Radhakrishnan
2014-08-12 5:37 ` Zhenqiang Chen
2014-08-12 9:24 ` Richard Earnshaw
2014-08-13 7:46 ` Zhenqiang Chen
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='CAJA7tRaHUngFY+=t8C0jaQmt-5uxFu4fEkAsj7u26Vp75x9PfA@mail.gmail.com' \
--to=ramana.gcc@googlemail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=ramrad01@arm.com \
--cc=zhenqiang.chen@linaro.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).