public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Question about IPA-PTA and build_alias
@ 2020-08-17 13:20 Erick Ochoa
  2020-08-24  7:40 ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Erick Ochoa @ 2020-08-17 13:20 UTC (permalink / raw)
  To: GCC Development; +Cc: Christoph Müllner, Philipp Tomsich

Hello,

I'm looking to understand better the points-to analysis (IPA-PTA) and 
the alias analysis (build_alias).

How is the information produced by IPA-PTA consumed?

Are alias sets in build_alias computed by the intersections of the 
points_to_set(s) (computed by IPA-PTA)?

My intuition tells me that it could be relatively simple to move 
build_alias to be an SIMPLE_IPA_PASS performed just after IPA-PTA, but I 
do not have enough experience in GCC to tell if this is correct. What 
could be some difficulties which I am not seeing? (Either move, or 
create a new IPA-ALIAS SIMPLE_IPA_PASS.) This pass would have the same 
sensitivity as IPA-PTA { flow-insensitive, context-insensitive, 
field-sensitive } because the alias sets could be computed by the 
intersection of points-to-sets.

Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question about IPA-PTA and build_alias
  2020-08-17 13:20 Question about IPA-PTA and build_alias Erick Ochoa
@ 2020-08-24  7:40 ` Richard Biener
  2020-08-24  8:00   ` Erick Ochoa
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2020-08-24  7:40 UTC (permalink / raw)
  To: Erick Ochoa; +Cc: GCC Development, Philipp Tomsich, Christoph Müllner

On Mon, Aug 17, 2020 at 3:22 PM Erick Ochoa
<erick.ochoa@theobroma-systems.com> wrote:
>
> Hello,
>
> I'm looking to understand better the points-to analysis (IPA-PTA) and
> the alias analysis (build_alias).
>
> How is the information produced by IPA-PTA consumed?
>
> Are alias sets in build_alias computed by the intersections of the
> points_to_set(s) (computed by IPA-PTA)?
>
> My intuition tells me that it could be relatively simple to move
> build_alias to be an SIMPLE_IPA_PASS performed just after IPA-PTA, but I
> do not have enough experience in GCC to tell if this is correct. What
> could be some difficulties which I am not seeing? (Either move, or
> create a new IPA-ALIAS SIMPLE_IPA_PASS.) This pass would have the same
> sensitivity as IPA-PTA { flow-insensitive, context-insensitive,
> field-sensitive } because the alias sets could be computed by the
> intersection of points-to-sets.

Both IPA-PTA and build_alias do the same, they build PTA constraint
sets, solve them and attach points-to info to SSA names.  Just IPA-PTA
does this for the whole TU while build_alias does it for a function at a time.

So I guess I do not understand your question.

Richard.

>
> Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question about IPA-PTA and build_alias
  2020-08-24  7:40 ` Richard Biener
@ 2020-08-24  8:00   ` Erick Ochoa
  2020-08-25 15:16     ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Erick Ochoa @ 2020-08-24  8:00 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Development, Philipp Tomsich, Christoph Müllner



On 24/08/2020 09:40, Richard Biener wrote:
> On Mon, Aug 17, 2020 at 3:22 PM Erick Ochoa
> <erick.ochoa@theobroma-systems.com> wrote:
>>
>> Hello,
>>
>> I'm looking to understand better the points-to analysis (IPA-PTA) and
>> the alias analysis (build_alias).
>>
>> How is the information produced by IPA-PTA consumed?
>>
>> Are alias sets in build_alias computed by the intersections of the
>> points_to_set(s) (computed by IPA-PTA)?
>>
>> My intuition tells me that it could be relatively simple to move
>> build_alias to be an SIMPLE_IPA_PASS performed just after IPA-PTA, but I
>> do not have enough experience in GCC to tell if this is correct. What
>> could be some difficulties which I am not seeing? (Either move, or
>> create a new IPA-ALIAS SIMPLE_IPA_PASS.) This pass would have the same
>> sensitivity as IPA-PTA { flow-insensitive, context-insensitive,
>> field-sensitive } because the alias sets could be computed by the
>> intersection of points-to-sets.
> 
> Both IPA-PTA and build_alias do the same, they build PTA constraint
> sets, solve them and attach points-to info to SSA names.  Just IPA-PTA
> does this for the whole TU while build_alias does it for a function at a time.
> 
> So I guess I do not understand your question.

Hi Richard,

I'm just trying to imagine what a data-layout optimization would look 
like if instead of using the type-escape analysis we used the points-to 
analysis to find out which variables/memory locations escape and what 
that would mean for the transformation itself.

One of the things that I think would be needed are alias-sets. I thought 
that build_alias was building alias sets but I was mistaken. However, 
computing the alias sets should not be too difficult.

Also continuing imagining what a data-layout optimization would look 
like in GCC, since IPA-PTA is a SIMPLE_IPA_PASS and if alias sets are 
indeed needed, I was asking what would be the reception to a 
SIMPLE_IPA_PASS that computes alias sets just after IPA-PTA. (As opposed 
to a full ipa pass).



> 
> Richard.
> 
>>
>> Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question about IPA-PTA and build_alias
  2020-08-24  8:00   ` Erick Ochoa
@ 2020-08-25 15:16     ` Richard Biener
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Biener @ 2020-08-25 15:16 UTC (permalink / raw)
  To: Erick Ochoa; +Cc: GCC Development, Philipp Tomsich, Christoph Müllner

On August 24, 2020 10:00:44 AM GMT+02:00, Erick Ochoa <erick.ochoa@theobroma-systems.com> wrote:
>
>
>On 24/08/2020 09:40, Richard Biener wrote:
>> On Mon, Aug 17, 2020 at 3:22 PM Erick Ochoa
>> <erick.ochoa@theobroma-systems.com> wrote:
>>>
>>> Hello,
>>>
>>> I'm looking to understand better the points-to analysis (IPA-PTA)
>and
>>> the alias analysis (build_alias).
>>>
>>> How is the information produced by IPA-PTA consumed?
>>>
>>> Are alias sets in build_alias computed by the intersections of the
>>> points_to_set(s) (computed by IPA-PTA)?
>>>
>>> My intuition tells me that it could be relatively simple to move
>>> build_alias to be an SIMPLE_IPA_PASS performed just after IPA-PTA,
>but I
>>> do not have enough experience in GCC to tell if this is correct.
>What
>>> could be some difficulties which I am not seeing? (Either move, or
>>> create a new IPA-ALIAS SIMPLE_IPA_PASS.) This pass would have the
>same
>>> sensitivity as IPA-PTA { flow-insensitive, context-insensitive,
>>> field-sensitive } because the alias sets could be computed by the
>>> intersection of points-to-sets.
>> 
>> Both IPA-PTA and build_alias do the same, they build PTA constraint
>> sets, solve them and attach points-to info to SSA names.  Just
>IPA-PTA
>> does this for the whole TU while build_alias does it for a function
>at a time.
>> 
>> So I guess I do not understand your question.
>
>Hi Richard,
>
>I'm just trying to imagine what a data-layout optimization would look 
>like if instead of using the type-escape analysis we used the points-to
>
>analysis to find out which variables/memory locations escape and what 
>that would mean for the transformation itself.

What I've said before is that for the object based approach you need precise following of pointers which covers escape analysis already. For non allocated objects you need to find possible address taken and accesses. 

I don't think the escape analysis included in IPA points-to analysis will help you in the end. The constraint solver does not do the precise analysis you need as well but the precise analysis will give you conservative escape results. 

>One of the things that I think would be needed are alias-sets. I
>thought 
>that build_alias was building alias sets but I was mistaken. However, 
>computing the alias sets should not be too difficult.
>
>Also continuing imagining what a data-layout optimization would look 
>like in GCC, since IPA-PTA is a SIMPLE_IPA_PASS and if alias sets are 
>indeed needed, I was asking what would be the reception to a 
>SIMPLE_IPA_PASS that computes alias sets just after IPA-PTA. (As
>opposed 
>to a full ipa pass).

If you look we skip simple analysis if IPA analysis was done to not overwrite its results. So forcing it (even earlier) would make IPA analysis moot which would of course not be welcome. 

Richard. 

>
>
>
>> 
>> Richard.
>> 
>>>
>>> Thanks!


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-25 15:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17 13:20 Question about IPA-PTA and build_alias Erick Ochoa
2020-08-24  7:40 ` Richard Biener
2020-08-24  8:00   ` Erick Ochoa
2020-08-25 15:16     ` Richard Biener

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).