From: rguenth Date: Fri, 5 Oct 2018 11:40:50 +0000 (+0000) Subject: 2018-10-05 Richard Biener X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71dad064f232dc31abfff4b3d5866178171846fe;p=thirdparty%2Fgcc.git 2018-10-05 Richard Biener * config/i386/i386.c (ix86_add_stmt_cost): When scalar cost is asked for initialize mode to the component mode of the vector type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264866 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e9edd10d8b9a..b8d4c9cbb7cf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-10-05 Richard Biener + + * config/i386/i386.c (ix86_add_stmt_cost): When scalar cost + is asked for initialize mode to the component mode of the + vector type. + 2018-10-05 H.J. Lu PR target/87522 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index d35ad91b55c0..fafdcd4115e8 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -49486,17 +49486,21 @@ ix86_add_stmt_cost (void *data, int count, enum vect_cost_for_stmt kind, { unsigned *cost = (unsigned *) data; unsigned retval = 0; + bool scalar_p + = (kind == scalar_stmt || kind == scalar_load || kind == scalar_store); tree vectype = stmt_info ? stmt_vectype (stmt_info) : NULL_TREE; int stmt_cost = - 1; bool fp = false; - machine_mode mode = TImode; + machine_mode mode = scalar_p ? SImode : TImode; if (vectype != NULL) { fp = FLOAT_TYPE_P (vectype); mode = TYPE_MODE (vectype); + if (scalar_p) + mode = TYPE_MODE (TREE_TYPE (vectype)); } if ((kind == vector_stmt || kind == scalar_stmt)