This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/81673] Harmful SLP vectorization
- From: "jamborm at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 02 Aug 2017 14:46:44 +0000
- Subject: [Bug tree-optimization/81673] Harmful SLP vectorization
- Auto-submitted: auto-generated
- References: <bug-81673-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81673
Martin Jambor <jamborm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2017-08-02
Assignee|unassigned at gcc dot gnu.org |jamborm at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> ---
For the record, our plan is to address this with the following patch
from Richi (after we benchmark it some more and if there are no
issues):
2017-08-01 Richard Biener <rguenther@suse.de>
PR tree-optimization/81673
* config/i386/i386.c (ix86_builtin_vectorization_cost): Increment
vec_construct cost for non-floats.
---
gcc/config/i386/i386.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 3caeeb0e377..1f1f4fbef72 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -46542,7 +46542,17 @@ ix86_builtin_vectorization_cost (enum
vect_cost_for_stmt type_of_cost,
return ix86_cost->vec_stmt_cost;
case vec_construct:
- return ix86_cost->vec_stmt_cost * (TYPE_VECTOR_SUBPARTS (vectype) - 1);
+ {
+ int cost
+ = ix86_cost->vec_stmt_cost * (TYPE_VECTOR_SUBPARTS (vectype) -
+ 1);
+ /* When the elements are integers the first insert isn't a move
+ that can be eliminated via RA but might even go through
+ the stack for the gpr->xmm move. */
+ if (! FLOAT_TYPE_P (TREE_TYPE (vectype)))
+ cost += 1;
+ return cost;
+ }
default:
gcc_unreachable ();