public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jiong Wang <jiong.wang@foss.arm.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Ramana Radhakrishnan <ramana.radhakrishnan@foss.arm.com>,
	Bernd Schmidt <bschmidt@redhat.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>, Jeff Law <law@redhat.com>
Subject: Re: PING: [PATCH] PR target/67215: -fno-plt needs improvements for x86
Date: Tue, 27 Oct 2015 15:27:00 -0000	[thread overview]
Message-ID: <562F97B3.7060408@foss.arm.com> (raw)
In-Reply-To: <CAMe9rOrOkzkY13Jja9VqNx536jqZZcuVYYaxOt6XcZGcP1gR+w@mail.gmail.com>



On 27/10/15 14:50, H.J. Lu wrote:
> On Tue, Oct 27, 2015 at 7:34 AM, Ramana Radhakrishnan
> <ramana.radhakrishnan@foss.arm.com> wrote:
>>> OK, then it's fairly x86-64 specific optimization, because we can't do "call *mem" in
>>> aarch64 and some other targets.
>> It is a fairly x86_64 specific optimization and doesn't apply to AArch64.
>>
>> The question really is what impact does removing the generic code handling have on aarch64 - is it a no-op or not for the existing -fno-plt implementation in the AArch64 backend ? The only case that is of interest is the bit below in calls.c and it looks like that may well be redundant with the logic in the backend already, but I have not done the full analysis to convince myself that the code in the backend is sufficient.
>>
>> -  && (!flag_plt
>> -              || lookup_attribute ("noplt", DECL_ATTRIBUTES (fndecl_or_type)))
>> -          && !targetm.binds_local_p (fndecl_or_type))
>>
> -fno-plt is a backend specific optimization and should be handled
> in backend.
>

The removing of those generic code has broken aarch64.

Actually those code in calls.c shouldn't prevent such "call *mem" 
opportunity on x86-64 because the combine pass
should combine "load reg, symbol + call reg" back into "call *mem" on 
x86-64 as there is related define_insn.

the testcases in PR67215 and included in your patch, all of which are 
loops, failed because either RTL PRE or loop pass will
hoist address calculation pattern as invariant out of loop into another 
basic block different with the call_insn. while combine
pass only work within basic block scope, thus we have missed such 
combine opportunity on x86-64.

I am not sure anyone has done experiment before on extend combine pass 
to larger scope.


  reply	other threads:[~2015-10-27 15:26 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 19:59 H.J. Lu
2015-10-27 11:28 ` Bernd Schmidt
2015-10-27 11:38   ` H.J. Lu
2015-10-27 12:52     ` Uros Bizjak
2015-10-27 12:57     ` Jiong Wang
2015-10-27 13:07       ` H.J. Lu
2015-10-27 13:55         ` Jiong Wang
2015-10-27 14:49           ` Ramana Radhakrishnan
2015-10-27 15:20             ` H.J. Lu
2015-10-27 15:27               ` Jiong Wang [this message]
2015-10-27 15:33                 ` H.J. Lu
2015-10-27 17:53                 ` Jeff Law
2015-10-27 15:45               ` Ramana Radhakrishnan
2015-10-27 17:50                 ` Jeff Law
2015-10-27 19:31                   ` H.J. Lu
2015-10-29  1:10                     ` Jeff Law
2015-10-29  1:11                       ` H.J. Lu
2015-10-29  1:14                         ` Bernd Schmidt
2015-10-29  1:21                           ` H.J. Lu
2015-10-29  1:47                             ` Bernd Schmidt
2015-10-29  3:39                               ` H.J. Lu
2015-10-29  9:46                                 ` Ramana Radhakrishnan
2015-10-29 17:18                                   ` Jeff Law
2015-10-29 17:15                             ` Jeff Law
2015-12-01 13:38                             ` David Edelsohn
2015-10-29 17:08                         ` Jeff Law
2015-10-27 21:02                 ` Jeff Law
2015-10-28 10:36                   ` Ramana Radhakrishnan
2015-10-28 11:01                     ` James Greenhalgh
2015-10-28 11:05                       ` James Greenhalgh
2015-10-28 14:45                         ` Ramana Radhakrishnan

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=562F97B3.7060408@foss.arm.com \
    --to=jiong.wang@foss.arm.com \
    --cc=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=law@redhat.com \
    --cc=ramana.radhakrishnan@foss.arm.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).