From: Evgeny Stupachenko Date: Thu, 17 Apr 2014 07:47:37 +0000 (+0000) Subject: i386.c (x86_add_stmt_cost): Fix vector cost model for Silvermont. X-Git-Tag: releases/gcc-5.1.0~8070 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=170c1776c45f875d346519a06514d510b0905fa8;p=thirdparty%2Fgcc.git i386.c (x86_add_stmt_cost): Fix vector cost model for Silvermont. gcc/ * config/i386/i386.c (x86_add_stmt_cost): Fix vector cost model for Silvermont. From-SVN: r209466 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c6fa5c08e5a0..320e15ab2899 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-04-17 Evgeny Stupachenko + + * config/i386/i386.c (x86_add_stmt_cost): Fix vector cost model for + Silvermont. + 2014-04-17 Evgeny Stupachenko * config/i386/x86-tune.def (TARGET_SLOW_PSHUFB): New tune definition. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 0ae3cdaf6cea..88142a8cf156 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -81,6 +81,7 @@ along with GCC; see the file COPYING3. If not see #include "context.h" #include "pass_manager.h" #include "target-globals.h" +#include "tree-vectorizer.h" static rtx legitimize_dllimport_symbol (rtx, bool); static rtx legitimize_pe_coff_extern_decl (rtx, bool); @@ -46329,6 +46330,18 @@ ix86_add_stmt_cost (void *data, int count, enum vect_cost_for_stmt kind, count *= 50; /* FIXME. */ retval = (unsigned) (count * stmt_cost); + + /* We need to multiply all vector stmt cost by 1.7 (estimated cost) + for Silvermont as it has out of order integer pipeline and can execute + 2 scalar instruction per tick, but has in order SIMD pipeline. */ + if (TARGET_SILVERMONT || TARGET_INTEL) + if (stmt_info && stmt_info->stmt) + { + tree lhs_op = gimple_get_lhs (stmt_info->stmt); + if (lhs_op && TREE_CODE (TREE_TYPE (lhs_op)) == INTEGER_TYPE) + retval = (retval * 17) / 10; + } + cost[where] += retval; return retval;