public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Andrew Pinski <pinskia@gmail.com>,
	 GCC Patches <gcc-patches@gcc.gnu.org>,
	Marcus Shawcroft <marcus.shawcroft@arm.com>,
	 Richard Earnshaw <Richard.Earnshaw@arm.com>,
	James Greenhalgh <james.greenhalgh@arm.com>
Subject: Re: [PATCH][AArch64] Separate shrink wrapping hooks implementation
Date: Fri, 18 Nov 2016 09:29:00 -0000	[thread overview]
Message-ID: <582EC9E9.8050303@foss.arm.com> (raw)
In-Reply-To: <20161117174550.GC3732@gate.crashing.org>


On 17/11/16 17:45, Segher Boessenkool wrote:
> On Thu, Nov 17, 2016 at 04:50:46PM +0000, Kyrill Tkachov wrote:
>>>> Is loading/storing a pair as cheap as loading/storing a single register?
>>>> In that case you could shrink-wrap per pair of registers instead.
>>> I suppose it can vary by microarchitecture. For the purposes of codegen
>>> I'd say
>>> it's more expensive than load/storing a single register (as there's more
>>> memory bandwidth required after all)
>>> but cheaper than two separate loads stores (alignment quirks
>>> notwithstanding).
>>> Interesting idea. That could help with code size too. I'll try it out.
>> I'm encountering some difficulties implementing this idea.
>> I want to still keep the per-register structures across the hooks but
>> basically restrict the number
>> of components in a basic block to an even number of FPRs and GPRs. I tried
>> doing this in COMPONENTS_FOR_BB
> So your COMPONENTS_FOR_BB returns both components in a pair whenever one
> of those is needed?  That should work afaics.
>

I mean I still want to have one component per register and since
emit_{prologue,epilogue}_components knows how to form pairs from the
components passed down to it I just need to restrict the number of
components in any particular basic block to an even number.
So say a function can wrap 5 registers: x22,x23,x24,x25,x26.
I want get_separate_components to return 5 components since in that hook
we don't know how these registers are distributed across each basic block.
components_for_bb has that information.
In components_for_bb I want to restrict the components for a basic block to
an even number, so if normally all 5 registers would be valid for wrapping
in that bb I'd only choose 4 so I could form 2 pairs. But selecting only 4
of the 5 registers, say only x22,x23,x24,x25 leads to x26 not being saved
or restored at all, even during the normal prologue and epilogue because
x26 was marked as a component in components_for_bb and therefore omitted from
the prologue and epilogue.
So I'm thinking x26 should be removed from the wrappable components of
a basic block by disqualify_components. I'm trying that approach now.

Thanks,
Kyrill

>> but apparently this ended up not saving/restoring some of the registers at
>> all because the components that were
>> "filtered out" that way still made their way to the bitmap passed into
>> SET_HANDLED_COMPONENTS and so the normal
>> prologue/epilogue didn't end up saving and restoring them.
> I am not sure what this means?  "filtered out"?
>
>
> Segher

  reply	other threads:[~2016-11-18  9:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-10 14:26 Kyrill Tkachov
2016-11-10 16:33 ` Segher Boessenkool
2016-11-10 16:45   ` Kyrill Tkachov
2016-11-10 22:42 ` Andrew Pinski
2016-11-10 23:39   ` Segher Boessenkool
2016-11-11 10:18     ` Kyrill Tkachov
2016-11-11 15:31       ` Kyrill Tkachov
2016-11-14 14:25         ` Kyrill Tkachov
2016-11-17 14:22           ` Kyrill Tkachov
2016-11-17 14:44             ` Segher Boessenkool
2016-11-17 14:55               ` Kyrill Tkachov
2016-11-17 15:02                 ` Segher Boessenkool
2016-11-17 15:06                   ` Kyrill Tkachov
2016-11-17 16:50                 ` Kyrill Tkachov
2016-11-17 17:46                   ` Segher Boessenkool
2016-11-18  9:29                     ` Kyrill Tkachov [this message]
2016-11-18 12:50                       ` Segher Boessenkool
2016-11-22 16:47                         ` Kyrill Tkachov
2016-11-29 10:58           ` James Greenhalgh
2016-11-29 11:18             ` Kyrill Tkachov
2016-11-29 11:32               ` Kyrill Tkachov
2016-11-29 11:37                 ` James Greenhalgh
2016-11-29 20:29             ` Segher Boessenkool
2016-11-30 14:08               ` Kyrill Tkachov
2016-12-02 17:09                 ` James Greenhalgh

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=582EC9E9.8050303@foss.arm.com \
    --to=kyrylo.tkachov@foss.arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=james.greenhalgh@arm.com \
    --cc=marcus.shawcroft@arm.com \
    --cc=pinskia@gmail.com \
    --cc=segher@kernel.crashing.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).