• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GCC with patches for OS216


Commit MetaInfo

Revisión628b78f9794a2eefcbc578011806bfa8e09b9ef7 (tree)
Tiempo2020-06-25 22:56:06
AutorRichard Biener <rguenther@suse...>
CommiterRichard Biener

Log Message

tree-optimization/95839 - allow CTOR vectorization without loads

This removes a premature check for enough datarefs in a basic-block
before we consider vectorizing it which leaves basic-blocks with
just vectorizable vector constructors unvectorized. The check
is effectively done by the following check for store groups
which then also include constructors.

2020-06-25 Richard Biener <rguenther@suse.de>

PR tree-optimization/95839
* tree-vect-slp.c (vect_slp_analyze_bb_1): Remove premature
check on the number of datarefs.

* gcc.dg/vect/bb-slp-pr95839.c: New testcase.

Cambiar Resumen

Diferencia incremental

--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr95839.c
@@ -0,0 +1,13 @@
1+/* { dg-do compile } */
2+/* { dg-require-effective-target vect_float } */
3+/* { dg-additional-options "-w -Wno-psabi" } */
4+
5+typedef float __attribute__((vector_size(16))) v4f32;
6+
7+v4f32 f(v4f32 a, v4f32 b)
8+{
9+ /* Check that we vectorize this CTOR without any loads. */
10+ return (v4f32){a[0] + b[0], a[1] + b[1], a[2] + b[2], a[3] + b[3]};
11+}
12+
13+/* { dg-final { scan-tree-dump "basic block vectorized" "slp2" } } */
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -3149,15 +3149,6 @@ vect_slp_analyze_bb_1 (bb_vec_info bb_vinfo, int n_stmts, bool &fatal)
31493149 return false;
31503150 }
31513151
3152- if (BB_VINFO_DATAREFS (bb_vinfo).length () < 2)
3153- {
3154- if (dump_enabled_p ())
3155- dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
3156- "not vectorized: not enough data-refs in "
3157- "basic block.\n");
3158- return false;
3159- }
3160-
31613152 if (!vect_analyze_data_ref_accesses (bb_vinfo))
31623153 {
31633154 if (dump_enabled_p ())
@@ -3169,9 +3160,9 @@ vect_slp_analyze_bb_1 (bb_vec_info bb_vinfo, int n_stmts, bool &fatal)
31693160
31703161 vect_slp_check_for_constructors (bb_vinfo);
31713162
3172- /* If there are no grouped stores in the region there is no need
3173- to continue with pattern recog as vect_analyze_slp will fail
3174- anyway. */
3163+ /* If there are no grouped stores and no constructors in the region
3164+ there is no need to continue with pattern recog as vect_analyze_slp
3165+ will fail anyway. */
31753166 if (bb_vinfo->grouped_stores.is_empty ())
31763167 {
31773168 if (dump_enabled_p ())