--- /dev/null
+/* { dg-do run } */
+
+#include "tree-vect.h"
+
+int main()
+{
+ check_vect ();
+
+ unsigned int tab[6][2] = { {69, 73}, {36, 40}, {24, 16},
+ {16, 11}, {4, 5}, {3, 1} };
+
+ int sum_0 = 0;
+ int sum_1 = 0;
+
+ for(int t=0; t<6; t++) {
+ sum_0 += tab[t][0];
+ sum_1 += tab[t][1];
+ }
+
+ int x1 = (sum_0 < 100);
+ int x2 = (sum_0 > 200);
+
+ if (x1 || x2 || sum_1 != 146)
+ __builtin_abort ();
+
+ return 0;
+}
--- /dev/null
+/* { dg-do run } */
+
+#include "tree-vect.h"
+
+int sum_1 = 0;
+
+int main()
+{
+ check_vect ();
+
+ unsigned int tab[6][2] = {{150, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}};
+
+ int sum_0 = 0;
+
+ for (int t = 0; t < 6; t++) {
+ sum_0 += tab[t][0];
+ sum_1 += tab[t][0];
+ }
+
+ if (sum_0 < 100 || sum_0 > 200)
+ __builtin_abort();
+ return 0;
+}
}
if (!REDUC_GROUP_FIRST_ELEMENT (vdef))
only_slp_reduc_chain = false;
- /* ??? For epilogue generation live members of the chain need
+ /* For epilogue generation live members of the chain need
to point back to the PHI via their original stmt for
- info_for_reduction to work. */
- if (STMT_VINFO_LIVE_P (vdef))
+ info_for_reduction to work. For SLP we need to look at
+ all lanes here - even though we only will vectorize from
+ the SLP node with live lane zero the other live lanes also
+ need to be identified as part of a reduction to be able
+ to skip code generation for them. */
+ if (slp_for_stmt_info)
+ {
+ for (auto s : SLP_TREE_SCALAR_STMTS (slp_for_stmt_info))
+ if (STMT_VINFO_LIVE_P (s))
+ STMT_VINFO_REDUC_DEF (vect_orig_stmt (s)) = phi_info;
+ }
+ else if (STMT_VINFO_LIVE_P (vdef))
STMT_VINFO_REDUC_DEF (def) = phi_info;
gimple_match_op op;
if (!gimple_extract_op (vdef->stmt, &op))
all involved stmts together. */
else if (slp_index != 0)
return true;
- else
- /* For SLP reductions the meta-info is attached to
- the representative. */
- stmt_info = SLP_TREE_REPRESENTATIVE (slp_node);
}
stmt_vec_info reduc_info = info_for_reduction (loop_vinfo, stmt_info);
gcc_assert (reduc_info->is_reduc_info);