This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Make vectorizer dumps more comparable
Richard Guenther <rguenther@suse.de> wrote on 01/09/2011 12:26:25 PM:
> > > Well, it seems to be different what everybody else does and it's
> > > highly redundant for a whole bunch of lines.
> > >
> > > But, it solves my diff issue and the overly long lines as well.
> > >
> > > Your patch changes both dump-file and stderr printing though,
> > > I did want to preserve stderr printing.
> >
> > OK.
> >
> > >
> > > For the dump-file I'd drop the 'line ' prefix and just print '%d: '.
> >
> > OK.
> >
> > >
> > > Btw, the diagnostic machinery does _not_ print locations
> > > for note (""), the location information is supposed to be printed
> > > in the heading warning/error. Thus, a much better format for stderr
> > > would be
> > >
> > > file.c:12: LOOP NOT VECTORIZED
> > > note: unsupported stmt '....'
> > >
> > > as the further notes will be printed with the 'loop location' which
> > > is confusing when dumping statements
> >
> > We usually print only one line, like
> >
> > file.c:12: note: <message> <stmt>
> >
> > so I don't really understand this part.
>
> It's a general note. With -ftree-vectorizer-verbose=5 we dump a lot
> of information with the same location (that of the loop header),
> but the individual messages refer not only to the overall loop
> but to specific statements, etc.
>
> This all is of course an artifact of sharing the dump file code
> with the reporting code.
I see.
Here is the new patch, I'll commit it after testing (on
powerpc64-suse-linux) if there are no objections.
Ira
ChangeLog:
* tree-vectorizer.c (vect_print_dump_info): Print line
number when dumping to a file.
(vectorize_loops): Add new messages to dump file.
Index: tree-vectorizer.c
===================================================================
--- tree-vectorizer.c (revision 178396)
+++ tree-vectorizer.c (working copy)
@@ -149,16 +149,12 @@ vect_print_dump_info (enum vect_verbosity_levels v
if (!current_function_decl || !vect_dump)
return false;
- if (dump_file)
- fprintf (vect_dump, "\n");
-
- else if (vect_location == UNKNOWN_LOC)
+ if (vect_location == UNKNOWN_LOC)
fprintf (vect_dump, "\n%s:%d: note: ",
DECL_SOURCE_FILE (current_function_decl),
DECL_SOURCE_LINE (current_function_decl));
else
- fprintf (vect_dump, "\n%s:%d: note: ",
- LOC_FILE (vect_location), LOC_LINE (vect_location));
+ fprintf (vect_dump, "\n%d: ", LOC_LINE (vect_location));
return true;
}
@@ -199,12 +195,22 @@ vectorize_loops (void)
loop_vec_info loop_vinfo;
vect_location = find_loop_location (loop);
+ if (vect_location != UNKNOWN_LOC
+ && vect_verbosity_level > REPORT_NONE)
+ fprintf (vect_dump, "\nAnalyzing loop at %s:%d\n",
+ LOC_FILE (vect_location), LOC_LINE (vect_location));
+
loop_vinfo = vect_analyze_loop (loop);
loop->aux = loop_vinfo;
if (!loop_vinfo || !LOOP_VINFO_VECTORIZABLE_P (loop_vinfo))
continue;
+ if (vect_location != UNKNOWN_LOC
+ && vect_verbosity_level > REPORT_NONE)
+ fprintf (vect_dump, "\n\nVectorizing loop at %s:%d\n",
+ LOC_FILE (vect_location), LOC_LINE (vect_location));
+
vect_transform_loop (loop_vinfo);
num_vectorized_loops++;
}