+2019-01-07 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR middle-end/88567
+ * tree-vect-loop.c (get_initial_defs_for_reduction): Pass the
+ output vector directly to duplicate_and_interleave instead of
+ going through a temporary. Postpone insertion of ctor_seq to
+ the end of the loop.
+
2019-01-07 Richard Earnshaw <rearnsha@arm.com>
PR target/86891
unsigned int group_size = stmts.length ();
unsigned int i;
struct loop *loop;
- auto_vec<tree, 16> permute_results;
vector_type = STMT_VINFO_VECTYPE (stmt_vinfo);
bool constant_p = true;
tree_vector_builder elts (vector_type, nunits, 1);
elts.quick_grow (nunits);
+ gimple_seq ctor_seq = NULL;
for (j = 0; j < nunits * number_of_vectors; ++j)
{
tree op;
if (number_of_places_left_in_vector == 0)
{
- gimple_seq ctor_seq = NULL;
tree init;
if (constant_p && !neutral_op
? multiple_p (TYPE_VECTOR_SUBPARTS (vector_type), nunits)
else
{
/* First time round, duplicate ELTS to fill the
- required number of vectors, then cherry pick the
- appropriate result for each iteration. */
- if (vec_oprnds->is_empty ())
- duplicate_and_interleave (&ctor_seq, vector_type, elts,
- number_of_vectors,
- permute_results);
- init = permute_results[number_of_vectors - j - 1];
+ required number of vectors. */
+ duplicate_and_interleave (&ctor_seq, vector_type, elts,
+ number_of_vectors, *vec_oprnds);
+ break;
}
- if (ctor_seq != NULL)
- gsi_insert_seq_on_edge_immediate (pe, ctor_seq);
vec_oprnds->quick_push (init);
number_of_places_left_in_vector = nunits;
constant_p = true;
}
}
+ if (ctor_seq != NULL)
+ gsi_insert_seq_on_edge_immediate (pe, ctor_seq);
}