public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Provide opt-info for autopar and graphite
@ 2017-02-01 10:43 Richard Biener
  2017-02-01 15:54 ` Sebastian Pop
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Biener @ 2017-02-01 10:43 UTC (permalink / raw)
  To: gcc-patches


The following provides opt-info for autopar and graphite.  That should
help to track down miscompilations by them given they usually do not
apply in many places (like for hunting down PR79321).

I've used the loop location of the loop containing the SCOP
which is probably reasonable for an option like -floop-nest-optimize.
There may be corner cases where this is confusing though (like when
that loop is the root of the loop tree and thus the SCOP covers
more than one outermost loop or when the SCOP covers adjacent loops
and the entry enters the first loop).  But ISTR we restrict SCOP
building / merging so that this doesn't happen (too often).

Bootstrap / regtest in progress on x86_64-unknown-linux-gnu (just to
check if any dump scanning is affected).

Richard.

2017-02-01  Richard Biener  <rguenther@suse.de>

	* graphite.c: Include tree-vectorizer.h for find_loop_location.
	(graphite_transform_loops): Provide opt-info for optimized nests.
	* tree-parloop.c (parallelize_loops): Provide opt-info for
	parallelized loops.

Index: gcc/graphite.c
===================================================================
--- gcc/graphite.c	(revision 245022)
+++ gcc/graphite.c	(working copy)
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3.
 #include "dbgcnt.h"
 #include "tree-parloops.h"
 #include "tree-cfgcleanup.h"
+#include "tree-vectorizer.h"
 #include "graphite.h"
 
 /* Print global statistics to FILE.  */
@@ -328,6 +329,11 @@ graphite_transform_loops (void)
 	   and could be in an inconsistent state.  */
 	if (!graphite_regenerate_ast_isl (scop))
 	  break;
+
+	location_t loc = find_loop_location
+			   (scop->scop_info->region.entry->dest->loop_father);
+	dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc,
+			 "loop nest optimized\n");
       }
 
   free_scops (scops);
Index: gcc/tree-parloops.c
===================================================================
--- gcc/tree-parloops.c	(revision 245022)
+++ gcc/tree-parloops.c	(working copy)
@@ -3322,17 +3322,14 @@ parallelize_loops (bool oacc_kernels_p)
 
       changed = true;
       skip_loop = loop->inner;
-      if (dump_file && (dump_flags & TDF_DETAILS))
-      {
-	if (loop->inner)
-	  fprintf (dump_file, "parallelizing outer loop %d\n",loop->header->index);
-	else
-	  fprintf (dump_file, "parallelizing inner loop %d\n",loop->header->index);
-	loop_loc = find_loop_location (loop);
-	if (loop_loc != UNKNOWN_LOCATION)
-	  fprintf (dump_file, "\nloop at %s:%d: ",
-		   LOCATION_FILE (loop_loc), LOCATION_LINE (loop_loc));
-      }
+
+      loop_loc = find_loop_location (loop);
+      if (loop->inner)
+	dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loop_loc,
+			 "parallelizing outer loop %d\n", loop->num);
+      else
+	dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loop_loc,
+			 "parallelizing inner loop %d\n", loop->num);
 
       gen_parallel_loop (loop, &reduction_list,
 			 n_threads, &niter_desc, oacc_kernels_p);

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

* Re: [PATCH] Provide opt-info for autopar and graphite
  2017-02-01 10:43 [PATCH] Provide opt-info for autopar and graphite Richard Biener
@ 2017-02-01 15:54 ` Sebastian Pop
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Pop @ 2017-02-01 15:54 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches

On Wed, Feb 1, 2017 at 4:43 AM, Richard Biener <rguenther@suse.de> wrote:
>         * graphite.c: Include tree-vectorizer.h for find_loop_location.
>         (graphite_transform_loops): Provide opt-info for optimized nests.
>         * tree-parloop.c (parallelize_loops): Provide opt-info for
>         parallelized loops.

Looks good to me.

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

end of thread, other threads:[~2017-02-01 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-01 10:43 [PATCH] Provide opt-info for autopar and graphite Richard Biener
2017-02-01 15:54 ` Sebastian Pop

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