public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vmakarov at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/64317] [5 Regression] Ineffective allocation of PIC base register
Date: Thu, 05 Mar 2015 15:37:00 -0000	[thread overview]
Message-ID: <bug-64317-4-Z1ev6mZUDj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64317-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64317

--- Comment #21 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
(In reply to Jeffrey A. Law from comment #17)
> Thanks Vlad, that patch helped.  Prior to your patch we had 15 reloads of
> the PIC register from memory, after your patch we have just 9.   However,
> several of the remaining 9 seem to be redundant.
> 
> LRA never considers a block starting with a label as participating in an
> EBB.  That's overly conservative.  A block can participate in an EBB if all
> of its predecessors are part of the same EBB.
> 
> That's particularly useful in CFGs like
>  
>     A
>    /|
>   / |
>  B  |
>   \ |
>    \|
>     C
> 
> [ Flow downward of course. ]
> 
> 
> If we assume that B is the fallthru path, then LRA will try to make AB into
> an EBB.  But it will not consider C because C will start with a label.  That
> ultimately causes missed inheritances in this example.

I am agree the bigger scope would help but it is hard to implement.  If we
consider the graph hammock structure, inherited value of pseudo P in A to C
might be changed in B.  It works if we don't change it in B but then the
structure can be dependent on considered pseudos for inheritance.  It is harder
to update live info too and to undo inheritance transformations if they fail.

The biggest problem with PIC pseudo is in that it can not treated as the rest
of pseudos with live range splitting perspective because of possible creation
of memory with pic pseudo value.  It is hard to decide what pseudo (or hard
register) to use for such memory in a particular place as it can be in
different pseudos (hard registers) if we permit usual pseudo live range
splitting for pic pseudo.


  parent reply	other threads:[~2015-03-05 15:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-15 15:03 [Bug rtl-optimization/64317] New: " izamyatin at gmail dot com
2014-12-15 15:07 ` [Bug rtl-optimization/64317] " rguenth at gcc dot gnu.org
2015-01-13 10:26 ` rguenth at gcc dot gnu.org
2015-01-23 20:17 ` vmakarov at gcc dot gnu.org
2015-02-05 12:22 ` enkovich.gnu at gmail dot com
2015-02-06  9:52 ` jakub at gcc dot gnu.org
2015-02-06 10:06 ` enkovich.gnu at gmail dot com
2015-02-10 22:17 ` vmakarov at gcc dot gnu.org
2015-02-12 21:04 ` law at redhat dot com
2015-02-13  3:35 ` vmakarov at gcc dot gnu.org
2015-02-13  3:37 ` vmakarov at gcc dot gnu.org
2015-02-13  8:06 ` enkovich.gnu at gmail dot com
2015-02-19 13:18 ` law at redhat dot com
2015-02-19 16:21 ` vmakarov at gcc dot gnu.org
2015-02-20 23:24 ` law at redhat dot com
2015-02-21 20:10 ` vmakarov at gcc dot gnu.org
2015-02-27 23:07 ` vmakarov at gcc dot gnu.org
2015-03-03 19:08 ` law at redhat dot com
2015-03-03 22:39 ` law at redhat dot com
2015-03-04 17:39 ` law at redhat dot com
2015-03-05 15:37 ` vmakarov at gcc dot gnu.org [this message]
2015-03-05 20:01 ` law at redhat dot com
2015-03-09 17:12 ` law at redhat dot com
2015-03-23  7:53 ` law at gcc dot gnu.org
2015-03-23  7:54 ` law at redhat dot com

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=bug-64317-4-Z1ev6mZUDj@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).