public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Dominators question
@ 2021-12-03 14:15 Andrew MacLeod
  2021-12-03 16:46 ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew MacLeod @ 2021-12-03 14:15 UTC (permalink / raw)
  To: Richard Biener; +Cc: Aldy Hernandez, gcc-patches

When something like the loop unswitching code adds elements to the CFGs, 
does this invalidate the dominators? or are they updated?  or is it in 
an in between state.

Im curious because a) the relation code uses it under the covers, and b) 
Im looking to add a ranger caching improvement which also uses 
dominators if they are available.

When blocks are added, I wonder what will happen to

   1) dom_info_available_p (CDI_DOMINATORS)  (is it still true), and 
then what happens to

   2) get_immediate_dominator (CDI_DOMINATORS, bb);  for one of the 
newly added BBs.

Thanks

Andrew


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

* Re: Dominators question
  2021-12-03 14:15 Dominators question Andrew MacLeod
@ 2021-12-03 16:46 ` Richard Biener
  2021-12-14 19:51   ` Andrew MacLeod
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2021-12-03 16:46 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: Aldy Hernandez, gcc-patches

On December 3, 2021 3:15:25 PM GMT+01:00, Andrew MacLeod <amacleod@redhat.com> wrote:
>When something like the loop unswitching code adds elements to the CFGs, 
>does this invalidate the dominators? or are they updated?  or is it in 
>an in between state.
>
>Im curious because a) the relation code uses it under the covers, and b) 
>Im looking to add a ranger caching improvement which also uses 
>dominators if they are available.
>
>When blocks are added, I wonder what will happen to
>
>   1) dom_info_available_p (CDI_DOMINATORS)  (is it still true), and 
>then what happens to
>
>   2) get_immediate_dominator (CDI_DOMINATORS, bb);  for one of the 
>newly added BBs.

Dominators are generally updated by most high level CFG manipulations, just the fast queries are invalidated. If a pass uses CFG manipulation that does not update dominators you will get ICEs or silent wron code... 

Richard. 

>Thanks
>
>Andrew
>


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

* Re: Dominators question
  2021-12-03 16:46 ` Richard Biener
@ 2021-12-14 19:51   ` Andrew MacLeod
  2021-12-14 20:00     ` Jeff Law
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew MacLeod @ 2021-12-14 19:51 UTC (permalink / raw)
  To: Richard Biener; +Cc: Aldy Hernandez, gcc-patches

On 12/3/21 11:46, Richard Biener wrote:
> On December 3, 2021 3:15:25 PM GMT+01:00, Andrew MacLeod <amacleod@redhat.com> wrote:
>> When something like the loop unswitching code adds elements to the CFGs,
>> does this invalidate the dominators? or are they updated?  or is it in
>> an in between state.
>>
>> Im curious because a) the relation code uses it under the covers, and b)
>> Im looking to add a ranger caching improvement which also uses
>> dominators if they are available.
>>
>> When blocks are added, I wonder what will happen to
>>
>>    1) dom_info_available_p (CDI_DOMINATORS)  (is it still true), and
>> then what happens to
>>
>>    2) get_immediate_dominator (CDI_DOMINATORS, bb);  for one of the
>> newly added BBs.
> Dominators are generally updated by most high level CFG manipulations, just the fast queries are invalidated. If a pass uses CFG manipulation that does not update dominators you will get ICEs or silent wron code...
>
> Richard.
>
Are post dominators generally available as well?  ie, does the presence 
of one imply the other?  or do I need to call calculate_dominance _info 
with CDI_POST_DOMINATORS?

Thanks

Andrew



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

* Re: Dominators question
  2021-12-14 19:51   ` Andrew MacLeod
@ 2021-12-14 20:00     ` Jeff Law
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Law @ 2021-12-14 20:00 UTC (permalink / raw)
  To: Andrew MacLeod, Richard Biener; +Cc: gcc-patches



On 12/14/2021 12:51 PM, Andrew MacLeod via Gcc-patches wrote:
> On 12/3/21 11:46, Richard Biener wrote:
>> On December 3, 2021 3:15:25 PM GMT+01:00, Andrew MacLeod 
>> <amacleod@redhat.com> wrote:
>>> When something like the loop unswitching code adds elements to the 
>>> CFGs,
>>> does this invalidate the dominators? or are they updated?  or is it in
>>> an in between state.
>>>
>>> Im curious because a) the relation code uses it under the covers, 
>>> and b)
>>> Im looking to add a ranger caching improvement which also uses
>>> dominators if they are available.
>>>
>>> When blocks are added, I wonder what will happen to
>>>
>>>    1) dom_info_available_p (CDI_DOMINATORS)  (is it still true), and
>>> then what happens to
>>>
>>>    2) get_immediate_dominator (CDI_DOMINATORS, bb);  for one of the
>>> newly added BBs.
>> Dominators are generally updated by most high level CFG 
>> manipulations, just the fast queries are invalidated. If a pass uses 
>> CFG manipulation that does not update dominators you will get ICEs or 
>> silent wron code...
>>
>> Richard.
>>
> Are post dominators generally available as well?  ie, does the 
> presence of one imply the other?  or do I need to call 
> calculate_dominance _info with CDI_POST_DOMINATORS?
They're built and maintained separately.

jeff


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

end of thread, other threads:[~2021-12-14 20:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 14:15 Dominators question Andrew MacLeod
2021-12-03 16:46 ` Richard Biener
2021-12-14 19:51   ` Andrew MacLeod
2021-12-14 20:00     ` Jeff Law

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