public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][RFC] Consolidate -O3 torture options
@ 2015-07-14 11:58 Richard Biener
  2015-07-14 15:25 ` Jeff Law
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2015-07-14 11:58 UTC (permalink / raw)
  To: gcc-patches


The following patch tries to consolidate the -O3 torture testing
options in the attempt to reduce testing time while not losing
coverage.

It drops testing of -funroll-all-loops (which nobody should use)
and retains only one non-default -O3 set of options - namely
-O3 plus those flags that would be enabled by -fprofile-use.

One should hope for ~20% less time in the C and dg tortures this way.

Didn't look into other tortures to apply the same yet (objc-torture?)

Currently testing on x86_64-unknown-linux-gnu.

For weird flag combinations we do have contributors that test
them and regularly report bugzillas.

Ok?

Comments?

Thanks,
Richard.

2015-07-14  Richard Biener  <rguenther@suse.de>

	* lib/c-torture.exp (C_TORTURE_OPTIONS): Remove
	{ -O3 -fomit-frame-pointer },
	{ -O3 -fomit-frame-pointer -funroll-loops } and
	{ -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions }
	in favor of
	{ -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer
	  -finline-functions }
	* lib/gcc-dg.exp (DG_TORTURE_OPTIONS): Likewise.

Index: gcc/testsuite/lib/c-torture.exp
===================================================================
--- gcc/testsuite/lib/c-torture.exp	(revision 225768)
+++ gcc/testsuite/lib/c-torture.exp	(working copy)
@@ -53,9 +53,7 @@ if [info exists TORTURE_OPTIONS] {
 	{ -O0 } \
 	{ -O1 } \
 	{ -O2 } \
-	{ -O3 -fomit-frame-pointer } \
-	{ -O3 -fomit-frame-pointer -funroll-loops } \
-	{ -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions } \
+	{ -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions } \
 	{ -O3 -g } \
 	{ -Os } \
 	{ -Og -g } ]
Index: gcc/testsuite/lib/gcc-dg.exp
===================================================================
--- gcc/testsuite/lib/gcc-dg.exp	(revision 225768)
+++ gcc/testsuite/lib/gcc-dg.exp	(working copy)
@@ -74,9 +74,7 @@ if [info exists TORTURE_OPTIONS] {
 	{ -O0 } \
 	{ -O1 } \
 	{ -O2 } \
-	{ -O3 -fomit-frame-pointer } \
-	{ -O3 -fomit-frame-pointer -funroll-loops } \
-	{ -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions } \
+	{ -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions } \
 	{ -O3 -g } \
 	{ -Os } ]
 

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

* Re: [PATCH][RFC] Consolidate -O3 torture options
  2015-07-14 11:58 [PATCH][RFC] Consolidate -O3 torture options Richard Biener
@ 2015-07-14 15:25 ` Jeff Law
  2015-07-15  8:12   ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Law @ 2015-07-14 15:25 UTC (permalink / raw)
  To: Richard Biener, gcc-patches

On 07/14/2015 05:58 AM, Richard Biener wrote:
>
> The following patch tries to consolidate the -O3 torture testing
> options in the attempt to reduce testing time while not losing
> coverage.
>
> It drops testing of -funroll-all-loops (which nobody should use)
> and retains only one non-default -O3 set of options - namely
> -O3 plus those flags that would be enabled by -fprofile-use.
>
> One should hope for ~20% less time in the C and dg tortures this way.
>
> Didn't look into other tortures to apply the same yet (objc-torture?)
>
> Currently testing on x86_64-unknown-linux-gnu.
>
> For weird flag combinations we do have contributors that test
> them and regularly report bugzillas.
>
> Ok?
>
> Comments?
>
> Thanks,
> Richard.
>
> 2015-07-14  Richard Biener  <rguenther@suse.de>
>
> 	* lib/c-torture.exp (C_TORTURE_OPTIONS): Remove
> 	{ -O3 -fomit-frame-pointer },
> 	{ -O3 -fomit-frame-pointer -funroll-loops } and
> 	{ -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions }
> 	in favor of
> 	{ -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer
> 	  -finline-functions }
> 	* lib/gcc-dg.exp (DG_TORTURE_OPTIONS): Likewise.
I think this is OK -- I've occasionally wondered about the additional 
coverage we get vs the amount of time spent for the various options.

I can't recall specific cases where one of those 3 options would trigger 
a failure, but the two didn't. I'm sure it's happened, but it's just 
common enough to warrant the amount of time we spend testing it.

This patch has the additional benefit that I think we can eliminate 
scanning the source for loops and eliminating the -funroll[-all]-loops 
options.   Hmm, that code may have already been dead... Hmmm.

jeff


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

* Re: [PATCH][RFC] Consolidate -O3 torture options
  2015-07-14 15:25 ` Jeff Law
@ 2015-07-15  8:12   ` Richard Biener
  2015-07-15 11:52     ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2015-07-15  8:12 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches

On Tue, 14 Jul 2015, Jeff Law wrote:

> On 07/14/2015 05:58 AM, Richard Biener wrote:
> > 
> > The following patch tries to consolidate the -O3 torture testing
> > options in the attempt to reduce testing time while not losing
> > coverage.
> > 
> > It drops testing of -funroll-all-loops (which nobody should use)
> > and retains only one non-default -O3 set of options - namely
> > -O3 plus those flags that would be enabled by -fprofile-use.
> > 
> > One should hope for ~20% less time in the C and dg tortures this way.
> > 
> > Didn't look into other tortures to apply the same yet (objc-torture?)
> > 
> > Currently testing on x86_64-unknown-linux-gnu.
> > 
> > For weird flag combinations we do have contributors that test
> > them and regularly report bugzillas.
> > 
> > Ok?
> > 
> > Comments?
> > 
> > Thanks,
> > Richard.
> > 
> > 2015-07-14  Richard Biener  <rguenther@suse.de>
> > 
> > 	* lib/c-torture.exp (C_TORTURE_OPTIONS): Remove
> > 	{ -O3 -fomit-frame-pointer },
> > 	{ -O3 -fomit-frame-pointer -funroll-loops } and
> > 	{ -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions }
> > 	in favor of
> > 	{ -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer
> > 	  -finline-functions }
> > 	* lib/gcc-dg.exp (DG_TORTURE_OPTIONS): Likewise.
> I think this is OK -- I've occasionally wondered about the additional coverage
> we get vs the amount of time spent for the various options.
> 
> I can't recall specific cases where one of those 3 options would trigger a
> failure, but the two didn't. I'm sure it's happened, but it's just common
> enough to warrant the amount of time we spend testing it.
> 
> This patch has the additional benefit that I think we can eliminate scanning
> the source for loops and eliminating the -funroll[-all]-loops options.   Hmm,
> that code may have already been dead... Hmmm.

Testing reveals one fallout:

FAIL: gcc.c-torture/execute/builtins/snprintf-chk.c execution,  -O3 
-fomit-frame
-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions 
FAIL: gcc.c-torture/execute/builtins/vsnprintf-chk.c execution,  -O3 
-fomit-fram
e-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions 

this is because -ftracer manages to thread things in a way that we
optimize away a _chk variant at compile-time and hit

  if (chk_calls != 5)
    abort ();

with chk_calls == 4.  I'm going to install the following alongside
(we've had similar issues with -ftree-loop-distribute-patterns enabled
by -O3).

Richard.

Index: gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp   (revision 
225768)
+++ gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp   (working 
copy)
@@ -37,7 +37,7 @@ load_lib c-torture.exp
 torture-init
 set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS
 
-set additional_flags "-fno-tree-loop-distribute-patterns"
+set additional_flags "-fno-tree-loop-distribute-patterns -fno-tracer"
 if [istarget "powerpc-*-darwin*"] {
    lappend additional_flags "-Wl,-multiply_defined,suppress"
 }

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

* Re: [PATCH][RFC] Consolidate -O3 torture options
  2015-07-15  8:12   ` Richard Biener
@ 2015-07-15 11:52     ` Richard Biener
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Biener @ 2015-07-15 11:52 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches

On Wed, 15 Jul 2015, Richard Biener wrote:

> On Tue, 14 Jul 2015, Jeff Law wrote:
> 
> > On 07/14/2015 05:58 AM, Richard Biener wrote:
> > > 
> > > The following patch tries to consolidate the -O3 torture testing
> > > options in the attempt to reduce testing time while not losing
> > > coverage.
> > > 
> > > It drops testing of -funroll-all-loops (which nobody should use)
> > > and retains only one non-default -O3 set of options - namely
> > > -O3 plus those flags that would be enabled by -fprofile-use.
> > > 
> > > One should hope for ~20% less time in the C and dg tortures this way.
> > > 
> > > Didn't look into other tortures to apply the same yet (objc-torture?)
> > > 
> > > Currently testing on x86_64-unknown-linux-gnu.
> > > 
> > > For weird flag combinations we do have contributors that test
> > > them and regularly report bugzillas.
> > > 
> > > Ok?
> > > 
> > > Comments?
> > > 
> > > Thanks,
> > > Richard.
> > > 
> > > 2015-07-14  Richard Biener  <rguenther@suse.de>
> > > 
> > > 	* lib/c-torture.exp (C_TORTURE_OPTIONS): Remove
> > > 	{ -O3 -fomit-frame-pointer },
> > > 	{ -O3 -fomit-frame-pointer -funroll-loops } and
> > > 	{ -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions }
> > > 	in favor of
> > > 	{ -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer
> > > 	  -finline-functions }
> > > 	* lib/gcc-dg.exp (DG_TORTURE_OPTIONS): Likewise.
> > I think this is OK -- I've occasionally wondered about the additional coverage
> > we get vs the amount of time spent for the various options.
> > 
> > I can't recall specific cases where one of those 3 options would trigger a
> > failure, but the two didn't. I'm sure it's happened, but it's just common
> > enough to warrant the amount of time we spend testing it.
> > 
> > This patch has the additional benefit that I think we can eliminate scanning
> > the source for loops and eliminating the -funroll[-all]-loops options.   Hmm,
> > that code may have already been dead... Hmmm.
> 
> Testing reveals one fallout:
> 
> FAIL: gcc.c-torture/execute/builtins/snprintf-chk.c execution,  -O3 
> -fomit-frame
> -pointer -funroll-loops -fpeel-loops -ftracer -finline-functions 
> FAIL: gcc.c-torture/execute/builtins/vsnprintf-chk.c execution,  -O3 
> -fomit-fram
> e-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions 
> 
> this is because -ftracer manages to thread things in a way that we
> optimize away a _chk variant at compile-time and hit
> 
>   if (chk_calls != 5)
>     abort ();
> 
> with chk_calls == 4.  I'm going to install the following alongside
> (we've had similar issues with -ftree-loop-distribute-patterns enabled
> by -O3).

The following adjusts objc-torture.exp (the only other I found with
the many -O3 variants).

Tested on x86_64-unknown-linux-gnu, applied.

Richard.

2015-07-15  Richard Biener  <rguenther@suse.de>

	* lib/objc-torture.exp (OBJC_TORTURE_OPTIONS): Remove
	{ -O3 -fomit-frame-pointer },
	{ -O3 -fomit-frame-pointer -funroll-loops } and
	{ -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions }
	in favor of
	{ -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer
	  -finline-functions }

Index: gcc/testsuite/lib/objc-torture.exp
===================================================================
--- gcc/testsuite/lib/objc-torture.exp	(revision 225807)
+++ gcc/testsuite/lib/objc-torture.exp	(working copy)
@@ -126,9 +126,7 @@ if [info exists TORTURE_OPTIONS] {
 	" -O0 " \
 	" -O1 " \
 	" -O2 " \
-	" -O3 -fomit-frame-pointer " \
-	" -O3 -fomit-frame-pointer -funroll-loops " \
-	" -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions " \
+	" -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions " \
 	" -O3 -g " \
 	" -Os " ]
 }

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-14 11:58 [PATCH][RFC] Consolidate -O3 torture options Richard Biener
2015-07-14 15:25 ` Jeff Law
2015-07-15  8:12   ` Richard Biener
2015-07-15 11:52     ` Richard Biener

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