From: JiangNing OS <jiangning@os.amperecomputing.com>
To: Martin Jambor <mjambor@suse.cz>, GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Jan Hubicka <hubicka@ucw.cz>
Subject: RE: [RFC] ipa: Adjust references to identify read-only globals
Date: Tue, 20 Jul 2021 08:53:39 +0000 [thread overview]
Message-ID: <DM6PR01MB54362F6FDC41B8AAB0DB17A19CE29@DM6PR01MB5436.prod.exchangelabs.com> (raw)
In-Reply-To: <ri6a6n8e85o.fsf@suse.cz>
> -----Original Message-----
> From: Gcc-patches <gcc-patches-
> bounces+jiangning=os.amperecomputing.com@gcc.gnu.org> On Behalf Of
> Martin Jambor
> Sent: Wednesday, June 30, 2021 4:19 AM
> To: GCC Patches <gcc-patches@gcc.gnu.org>
> Cc: Jan Hubicka <hubicka@ucw.cz>
> Subject: [RFC] ipa: Adjust references to identify read-only globals
>
> Hi,
>
> this patch has been motivated by SPEC 2017's 544.nab_r in which there is a
> static variable which is never written to and so zero throughout the run-time
> of the benchmark. However, it is passed by reference to a function in which
> it is read and (after some multiplications) passed into __builtin_exp which in
> turn unnecessarily consumes almost 10% of the total benchmark run-time.
I do see ~8.5% runtime reduction on aarch64.
> The situation is illustrated by the added testcase remref-3.c.
>
> The patch adds a flag to ipa-prop descriptor of each parameter to mark such
> parameters. IPA-CP and inling then take the effort to remove IPA_REF_ADDR
> references in the caller and only add IPA_REF_LOAD reference to the
> clone/overall inlined function. This is sufficient for subsequent symbol table
> analysis code to identify the read-only variable as such and optimize the code.
>
> I plan to compile a number of packages with the patch to test it some more
> and get a bit better idea of its impact. But it has passed bootstrap,
> LTObootstrap and testing on x86_64-linux and i686-linux and so unless I find
> any problem, I would like to commit it at some point next month without any
> major changes, so I'd be grateful for any feedback even now.
I see 3 cases in SPEC2017 failed to compile on aarch64, i.e. 521.wrf_r, 527.cam4_r, 554.roms_r. For example,
pre_step3d.fppized.f90:1260:35: internal compiler error: Segmentation fault
1260 | CALL wclock_on (ng, iNLM, 22)
| ^
0x1645c6b internal_error(char const*, ...)
???:0
0xe1f4f4 place_block_symbol(rtx_def*)
???:0
0x84ab33 use_anchored_address(rtx_def*)
???:0
0x868203 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool)
???:0
0x868793 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool)
???:0
0x75b593 expand_call(tree_node*, rtx_def*, int)
???:0
0x86a09f expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool)
???:0
Please submit a full bug report
Thanks,
-Jiangning
next prev parent reply other threads:[~2021-07-20 8:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-29 20:18 Martin Jambor
2021-07-15 16:04 ` Jan Hubicka
2021-07-20 8:53 ` JiangNing OS [this message]
2021-07-20 10:49 ` Richard Biener
2021-07-20 13:39 ` Martin Jambor
2021-07-22 12:43 ` Martin Jambor
2021-07-27 7:46 ` JiangNing OS
2021-07-27 9:39 ` Martin Jambor
2021-07-28 5:47 ` JiangNing OS
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=DM6PR01MB54362F6FDC41B8AAB0DB17A19CE29@DM6PR01MB5436.prod.exchangelabs.com \
--to=jiangning@os.amperecomputing.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
--cc=mjambor@suse.cz \
/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).