// We should have if-converted everything down to straight-line code
// { dg-final { scan-tree-dump-times "<bb \[0-9\]+>" 1 "slp2" } }
-// { dg-final { scan-tree-dump-times "basic block part vectorized" 1 "slp2" { xfail { { ! vect_element_align } && { ! vect_hw_misalign } } } } }
+// { dg-final { scan-tree-dump-times "Basic block will be vectorized using SLP" 1 "slp2" { xfail { { ! vect_element_align } && { ! vect_hw_misalign } } } } }
// It's a bit awkward to detect that all stores were vectorized but the
// following more or less does the trick
// { dg-final { scan-tree-dump "vect_\[^\r\m\]* = MIN" "slp2" { xfail { { ! vect_element_align } && { ! vect_hw_misalign } } } } }
}
/* We need V2SI vector add support for the b[] vectorization, if we don't
- have that we might only see the store vectorized and thus 2 subgraphs. */
-/* { dg-final { scan-tree-dump-times "optimized: basic block" 1 "slp2" { target { vect_int_mult && vect64 } } } } */
+ have that we might only see the store vectorized. In any case we have
+ two subgraph entries. */
+/* { dg-final { scan-tree-dump-times "optimized: basic block" 2 "slp2" { target { vect_int_mult && vect64 } } } } */
"using SLP\n");
vectorized = true;
+ /* Dump before scheduling as store vectorization will remove
+ the original stores and mess with the instance tree
+ so querying its location will eventually ICE. */
+ if (flag_checking)
+ for (slp_instance sub : instance->subgraph_entries)
+ gcc_assert (SLP_TREE_VECTYPE (SLP_INSTANCE_TREE (sub)));
+ unsigned HOST_WIDE_INT bytes;
+ if (dump_enabled_p ())
+ for (slp_instance sub : instance->subgraph_entries)
+ {
+ tree vtype = SLP_TREE_VECTYPE (SLP_INSTANCE_TREE (sub));
+ if (GET_MODE_SIZE (TYPE_MODE (vtype)).is_constant (&bytes))
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS,
+ sub->location (),
+ "basic block part vectorized using %wu "
+ "byte vectors\n", bytes);
+ else
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS,
+ sub->location (),
+ "basic block part vectorized using "
+ "variable length vectors\n");
+ }
+
dump_user_location_t saved_vect_location = vect_location;
vect_location = instance->location ();
vect_schedule_slp (bb_vinfo, instance->subgraph_entries);
- unsigned HOST_WIDE_INT bytes;
- if (dump_enabled_p ())
- {
- if (GET_MODE_SIZE
- (bb_vinfo->vector_mode).is_constant (&bytes))
- dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
- "basic block part vectorized using %wu "
- "byte vectors\n", bytes);
- else
- dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
- "basic block part vectorized using "
- "variable length vectors\n");
- }
-
vect_location = saved_vect_location;
}
}