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]

XFAIL support for profile-based optimizations





Recently I have been developing testcases for struct-reorg optimization and
found out that XFAIL support is missing for all profile-based optimization
testcases.

Although there is a patch, developed by Janis (a bit old one!), that kindly
provide this functionality, it does not seem to have been committed to
mainline:

http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00355.html

Is there any reason for it? I need this functionality and wonder how other
profile-based optimizations managed without it.

Here's a the patch for struct-reorg-branch that works for me:

Index: testsuite/lib/profopt.exp
===================================================================
--- testsuite/lib/profopt.exp   (revision 108853)
+++ testsuite/lib/profopt.exp   (working copy)
@@ -221,6 +221,23 @@
         error "No feedback option specified for second compile."
     }

+    # Get special options for this test from the .x file, if presnet.
+    # This can include the following strings to pass to setup_xfail
+    # for various test steps that might be expected to fail:
+    #   profopt_compile1_xfail
+    #   profopt_execute1_xfail
+    #   profopt_compile2_xfail
+    #   profopt_execute2_xfail
+    #   profopt_perfcheck_xfail
+    if [file exists [file rootname $src].x] {
+       verbose "Using alternate driver [file rootname [file tail $src]].x"
2
+       set done_p 0
+       catch "set done_p \[source [file rootname $src].x\]"
+       if { $done_p } {
+           return
+       }
+    }
+
     regsub "^$srcdir/?" $src "" testcase
     # If we couldn't rip $srcdir out of `src' then just do the best we
can.
     # The point is to reduce the unnecessary noise in the logs.  Don't
strip
@@ -264,6 +281,9 @@

        # Compile for profiling.

+       if [info exists profopt_compile1_xfail] {
+           setup_xfail $profopt_compile1_xfail
+       }
        set options ""
        lappend options "additional_flags=$option $extra_flags
$profile_option"
        set optstr "$option $profile_option"
@@ -277,6 +297,9 @@

        # Run the profiled test.

+       if [info exists profopt_execute1_xfail] {
+           setup_xfail $profopt_execute1_xfail
+       }
        set result [${tool}_load $execname1 "" ""]
        set status [lindex $result 0]
        set missing_file 0
@@ -314,6 +337,9 @@

        # Compile with feedback-directed optimizations.

+       if [info exists profopt_compile2_xfail] {
+           setup_xfail $profopt_compile2_xfail
+       }
        set options ""
        lappend options "additional_flags=$option $extra_flags
$feedback_option"
        set optstr "$option $feedback_option"
@@ -325,6 +351,9 @@

        # Run the profile-directed optimized test.

+       if [info exists profopt_execute2_xfail] {
+           setup_xfail $profopt_execute2_xfail
+       }
        set result [${tool}_load "$execname2" "" ""]
        set status [lindex $result 0]
        $status "$testcase execution,   $optstr"
@@ -394,6 +423,9 @@
        # Compare results of the two runs and fail if the time with the
        # profile-directed optimization is significantly more than the time
        # without it.
+       if [info exists profopt_perfcheck_xfail] {
+           setup_xfail $profopt_perfcheck_xfail
+       }
        set status "pass"
        if { $val2 > $val1 } {
            # Check for a performance degration outside of allowable
limits.

Olga


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