public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] comment precising need to use free_dominance_info
@ 2011-05-12  6:55 piervit
  2011-05-12 11:32 ` Richard Guenther
  0 siblings, 1 reply; 3+ messages in thread
From: piervit @ 2011-05-12  6:55 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 397 bytes --]

After using function flow_loops_find in cfgloop.c, it is needed to use 
free_dominance_info to clear structure which have beend added by the 
use of calculate_dominance_info.

I have added a comment precising this.

My contributor number is 634276.


ChangeLog:
2011-05-11  Pierre Vittet  <piervit@pvittet.com>

	* cfgloop.c (flow_loops_find): Add comment remembering to call
	free_dominance_info

[-- Attachment #2: comment_flow_loops_find.diff --]
[-- Type: text/plain, Size: 610 bytes --]

Index: gcc/cfgloop.c
===================================================================
--- gcc/cfgloop.c	(revision 173677)
+++ gcc/cfgloop.c	(working copy)
@@ -368,6 +368,11 @@ init_loops_structure (struct loops *loops, unsigne
 
 /* Find all the natural loops in the function and save in LOOPS structure and
    recalculate loop_depth information in basic block structures.
+
+   This function calls calculate_dominance_info which allocates a structure to
+   handle dominance. It must be freed after use with the function
+   free_dominance_info.
+
    Return the number of natural loops found.  */
 
 int

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

* Re: [PATCH] comment precising need to use free_dominance_info
  2011-05-12  6:55 [PATCH] comment precising need to use free_dominance_info piervit
@ 2011-05-12 11:32 ` Richard Guenther
  2011-05-17 16:33   ` Pierre Vittet
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Guenther @ 2011-05-12 11:32 UTC (permalink / raw)
  To: piervit; +Cc: gcc-patches

On Thu, May 12, 2011 at 12:14 AM,  <piervit@pvittet.com> wrote:
> After using function flow_loops_find in cfgloop.c, it is needed to use
> free_dominance_info to clear structure which have beend added by the use of
> calculate_dominance_info.
>
> I have added a comment precising this.
>
> My contributor number is 634276.

The patch is not correct.  Keeping dom info live is ok.

Richard.

>
> ChangeLog:
> 2011-05-11  Pierre Vittet  <piervit@pvittet.com>
>
>        * cfgloop.c (flow_loops_find): Add comment remembering to call
>        free_dominance_info
>

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

* Re: [PATCH] comment precising need to use free_dominance_info
  2011-05-12 11:32 ` Richard Guenther
@ 2011-05-17 16:33   ` Pierre Vittet
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Vittet @ 2011-05-17 16:33 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 279 bytes --]

So maybe this patch adding a comment on calculate_dominance_info is more 
adapted.

ChangeLog:
2011-05-17  Pierre Vittet<piervit@pvittet.com>

	* dominance.c (calculate_dominance_info): Add comment
	   precising when to free with free_dominance_info

contributor number: 634276


[-- Attachment #2: comment_calculate_dominance_info.diff --]
[-- Type: text/plain, Size: 768 bytes --]

Index: gcc/dominance.c
===================================================================
--- gcc/dominance.c	(revision 173830)
+++ gcc/dominance.c	(working copy)
@@ -628,8 +628,15 @@ compute_dom_fast_query (enum cdi_direction dir)
 }
 
 /* The main entry point into this module.  DIR is set depending on whether
-   we want to compute dominators or postdominators.  */
+   we want to compute dominators or postdominators.  
 
+   We try to keep dominance info alive as long as possible (to avoid
+   recomputing it often). It has to be freed with free_dominance_info when CFG
+   transformation makes it invalide. 
+   
+   post_dominance info is less often used, and should be freed after each use.
+*/
+
 void
 calculate_dominance_info (enum cdi_direction dir)
 {

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

end of thread, other threads:[~2011-05-17 14:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-12  6:55 [PATCH] comment precising need to use free_dominance_info piervit
2011-05-12 11:32 ` Richard Guenther
2011-05-17 16:33   ` Pierre Vittet

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