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]

[PATCH] PR/32086, enable cost model by default on i386


This fixes a serious polyhedron performance regression.

Booted/tested with -O3 -g on i386-pc-linux-gnu. Only using the config/i386/i386.c hunk had many failures (due to the cost model's decisions not to vectorize), but no ICEs.

Ok?

Paolo
2007-12-05  Paolo Bonzini  <bonzini@gnu.org>

	* config/i386/i386.c (override_options): Enable -fvect-cost-model.

2007-12-05  Paolo Bonzini  <bonzini@gnu.org>

	* gcc.dg/vect/vect.exp (DEFAULT_VECTCFLAGS): Disable cost model.
	* g++.dg/vect/vect.exp (DEFAULT_VECTCFLAGS): Disable cost model.
	* gfortran.dg/vect/vect.exp (DEFAULT_VECTCFLAGS): Disable cost model.

Index: gcc/testsuite/gcc.dg/vect/vect.exp
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect.exp	(revision 130513)
+++ gcc/testsuite/gcc.dg/vect/vect.exp	(working copy)
@@ -23,7 +23,7 @@ load_lib gcc-dg.exp
 set DEFAULT_VECTCFLAGS ""
 
 # These flags are used for all targets.
-lappend DEFAULT_VECTCFLAGS "-ftree-vectorize"
+lappend DEFAULT_VECTCFLAGS "-ftree-vectorize" "-fno-vect-cost-model"
 
 # If the target system supports vector instructions, the default action
 # for a test is 'run', otherwise it's 'compile'.  Save current default.
Index: gcc/testsuite/g++.dg/vect/vect.exp
===================================================================
--- gcc/testsuite/g++.dg/vect/vect.exp	(revision 130513)
+++ gcc/testsuite/g++.dg/vect/vect.exp	(working copy)
@@ -39,7 +39,7 @@ set save-dg-do-what-default ${dg-do-what
 set DEFAULT_VECTCFLAGS ""
 
 # These flags are used for all targets.
-lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" \
+lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model" \
   "-ftree-vectorizer-verbose=4" "-fdump-tree-vect-stats"
 
 # Skip these tests for targets that do not support generating vector
Index: gcc/testsuite/gfortran.dg/vect/vect.exp
===================================================================
--- gcc/testsuite/gfortran.dg/vect/vect.exp	(revision 130513)
+++ gcc/testsuite/gfortran.dg/vect/vect.exp	(working copy)
@@ -24,7 +24,7 @@ load_lib target-supports.exp
 set DEFAULT_VECTCFLAGS ""
 
 # These flags are used for all targets.
-lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" \
+lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fno-vect-cost-model" \
   "-ftree-vectorizer-verbose=4" "-fdump-tree-vect-stats"
 
 # If the target system supports vector instructions, the default action
Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c	(revision 130513)
+++ gcc/config/i386/i386.c	(working copy)
@@ -2928,6 +2928,7 @@ optimization_options (int level, int siz
     flag_omit_frame_pointer = 2;
   flag_pcc_struct_return = 2;
   flag_asynchronous_unwind_tables = 2;
+  flag_vect_cost_model = 1;
 #ifdef SUBTARGET_OPTIMIZATION_OPTIONS
   SUBTARGET_OPTIMIZATION_OPTIONS;
 #endif

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