public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Improve comments in pass_tree_loop_init::execute
@ 2015-11-17 10:50 Tom de Vries
  2015-11-17 11:41 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Tom de Vries @ 2015-11-17 10:50 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Biener

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

Hi,

this no-functional-changes patch improves comments in 
pass_tree_loop_init::execute.

For the discussion related to the comment for scev_initialize, see:
- https://gcc.gnu.org/ml/gcc-patches/2013-02/msg01127.html
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56426

OK for trunk?

Thanks,
- Tom

[-- Attachment #2: 0017-Improve-comments-in-pass_tree_loop_init-execute.patch --]
[-- Type: text/x-patch, Size: 1327 bytes --]

Improve comments in pass_tree_loop_init::execute

2015-11-17  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-loop.c (pass_tree_loop_init::execute): Improve comments.

---
 gcc/tree-ssa-loop.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index 570406f..40df84f 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -276,12 +276,21 @@ public:
 unsigned int
 pass_tree_loop_init::execute (function *fun ATTRIBUTE_UNUSED)
 {
+  /* When processing a loop in the loop pipeline, we should be able to assert
+     that:
+       (loops_state_satisfies_p (LOOPS_NORMAL | LOOPS_HAVE_RECORDED_EXITS
+					      | LOOP_CLOSED_SSA)
+	&& scev_initialized_p ())
+  */
+
   loop_optimizer_init (LOOPS_NORMAL
 		       | LOOPS_HAVE_RECORDED_EXITS);
   rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa);
 
-  /* We might discover new loops, e.g. when turning irreducible
-     regions into reducible.  */
+  /* Note that we run scev_initialize here even if number_of_loops () <= 1.
+     Even if we have no real loops now, we might discover new loops while
+     executing the loop pipeline, e.g. when turning irreducible regions into
+     reducible, in which case we still would need scev to be initialized.  */
   scev_initialize ();
 
   return 0;

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

* Re: [PATCH] Improve comments in pass_tree_loop_init::execute
  2015-11-17 10:50 [PATCH] Improve comments in pass_tree_loop_init::execute Tom de Vries
@ 2015-11-17 11:41 ` Richard Biener
  2015-11-17 21:47   ` Tom de Vries
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2015-11-17 11:41 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gcc-patches

On Tue, 17 Nov 2015, Tom de Vries wrote:

> Hi,
> 
> this no-functional-changes patch improves comments in
> pass_tree_loop_init::execute.
> 
> For the discussion related to the comment for scev_initialize, see:
> - https://gcc.gnu.org/ml/gcc-patches/2013-02/msg01127.html
> - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56426
> 
> OK for trunk?

The comment about SCEV is no longer accurate as we gate pass_tree_loop
on having "real" loops.

Richard.

> Thanks,
> - Tom
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)

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

* Re: [PATCH] Improve comments in pass_tree_loop_init::execute
  2015-11-17 11:41 ` Richard Biener
@ 2015-11-17 21:47   ` Tom de Vries
  0 siblings, 0 replies; 3+ messages in thread
From: Tom de Vries @ 2015-11-17 21:47 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

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

On 17/11/15 12:41, Richard Biener wrote:
> On Tue, 17 Nov 2015, Tom de Vries wrote:
>
>> Hi,
>>
>> this no-functional-changes patch improves comments in
>> pass_tree_loop_init::execute.
>>
>> For the discussion related to the comment for scev_initialize, see:
>> - https://gcc.gnu.org/ml/gcc-patches/2013-02/msg01127.html
>> - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56426
>>
>> OK for trunk?
>
> The comment about SCEV is no longer accurate as we gate pass_tree_loop
> on having "real" loops.

I see. Removed scev comment, committed as attached.

Thanks,
- Tom


[-- Attachment #2: 0004-Improve-comments-in-pass_tree_loop_init-execute.patch --]
[-- Type: text/x-patch, Size: 1010 bytes --]

Improve comments in pass_tree_loop_init::execute

2015-11-17  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-loop.c (pass_tree_loop_init::execute): Improve comments.

---
 gcc/tree-ssa-loop.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index 8ecd140..afdef12 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -211,12 +211,15 @@ public:
 unsigned int
 pass_tree_loop_init::execute (function *fun ATTRIBUTE_UNUSED)
 {
+  /* When processing a loop in the loop pipeline, we should be able to assert
+     that:
+       (loops_state_satisfies_p (LOOPS_NORMAL | LOOPS_HAVE_RECORDED_EXITS
+					      | LOOP_CLOSED_SSA)
+	&& scev_initialized_p ())
+  */
   loop_optimizer_init (LOOPS_NORMAL
 		       | LOOPS_HAVE_RECORDED_EXITS);
   rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa);
-
-  /* We might discover new loops, e.g. when turning irreducible
-     regions into reducible.  */
   scev_initialize ();
 
   return 0;

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

end of thread, other threads:[~2015-11-17 21:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-17 10:50 [PATCH] Improve comments in pass_tree_loop_init::execute Tom de Vries
2015-11-17 11:41 ` Richard Biener
2015-11-17 21:47   ` Tom de Vries

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