This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [testsuite] preliminary: directives in profile-directed opt tests


On Tue, May 24, 2005 at 10:37:53AM +0200, Jan Hubicka wrote:
> > On Mon, May 23, 2005 at 11:42:27AM +0200, Jan Hubicka wrote:
> > > > Honza and I recently chatted on IRC about support for looking at dump
> > > > files in tests of profile-directed optimizations.  Here's a preliminary
> > > > attempt to support that.  I'm primarily intested in Honza's feedback
> > > > right now, but anyone is welcome to jump in with suggestions.
> > > 
> > > Thanks!
> > > I was bit occupied by the work on fixing remaining failures, but I am
> > > going to give it a try now.  It looks pretty much like what I need ineed
> > > ;)
> > 
> > Here's a new version which sets up a variable with a name expected by
> > dump and cleanup procedures, and which does a better job of cleaning
> > up after a test failure.
> Thanks, this seems to work perfectly for me!  Do you think you can get
> the infrastructure bits into compiler?  (I have the inliner patch ready
> now too ;)

They are in now, after further testing of existing tests with -m32 and
-m64 on powerpc64-unknown-linux-gnu and with the following ChangeLogs:

2005-05-24  Janis Johnson  <janis187@us.ibm.com>

	* lib/profopt.exp (dg-final-generate, dg-final-use,
	profopt-final-code, profopt-get-options): New.
	(profopt-execute): Process test directives.

	* lib/gcc-dg.exp (cleanup-ipa-dump): New.
	(cleanup-coverage-files, cleanup-repo-files, cleanup-rtl-dump,
	cleanup-tree-dump, cleanup-saved-temps): Update comments.

Here's the expect file for a directory specific to tree profiling tests.
Would gcc.dg/tree-prof be a good name for that?

2005-05-24  Janis Johnson  <janis187@us.ibm.com>

	* gcc.dg/tree-prof: New directory.
	* gcc.dg/tree-prof/tree-prof.exp: New.

--- /dev/null	2004-06-24 11:06:20.000000000 -0700
+++ gcc.dg/tree-prof/tree-prof.exp	2005-05-24 14:31:24.000000000 -0700
@@ -0,0 +1,53 @@
+#   Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+
+# Test the functionality of programs compiled with profile-directed block
+# ordering using -fprofile-arcs followed by -fbranch-probabilities.
+
+load_lib target-supports.exp
+
+# Some targets don't support tree profiling.
+if { ![check_profiling_available "-ftree-based-profiling"] } {
+    return
+}
+
+# The procedures in profopt.exp need these parameters.
+set tool gcc
+set prof_ext "gcda gcno"
+
+# Override the list defined in profopt.exp.
+set PROFOPT_OPTIONS [list {}]
+
+if $tracelevel then {
+    strace $tracelevel
+}
+
+# Load support procs.
+load_lib profopt.exp
+
+# These are globals used by profopt-execute.  The first is options
+# needed to generate profile data, the second is options to use the
+# profile data.
+set profile_option "-ftree-based-profiling -fprofile-generate"
+set feedback_option "-ftree-based-profiling -fprofile-use"
+
+foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
+    # If we're only testing specific files and this isn't one of them, skip it.
+    if ![runtest_file_p $runtests $src] then {
+        continue
+    }
+    profopt-execute $src
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]