#include "tree-ssa-dce.h"
#include "memmodel.h"
#include "optabs.h"
+#include "gimple-fold.h"
/* Expand all ARRAY_REF(VIEW_CONVERT_EXPR) gimple assignments into calls to
internal function based on vector type of selected expansion.
lhs = gimple_assign_lhs (stmt);
machine_mode mode = TYPE_MODE (TREE_TYPE (lhs));
+ /* Lower mask typed, non-vector mode VEC_COND_EXPRs to bitwise operations.
+ Those can end up generated by folding and at least for integer mode masks
+ we cannot expect vcond expanders to exist. We lower a ? b : c
+ to (b & a) | (c & ~a). */
+ if (!VECTOR_MODE_P (mode))
+ {
+ gcc_assert (VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (lhs))
+ && types_compatible_p (TREE_TYPE (op0), TREE_TYPE (op1)));
+ gimple_seq stmts = NULL;
+ tree type = TREE_TYPE (lhs);
+ location_t loc = gimple_location (stmt);
+ tree tem0 = gimple_build (&stmts, loc, BIT_AND_EXPR, type, op1, op0);
+ tree tem1 = gimple_build (&stmts, loc, BIT_NOT_EXPR, type, op0);
+ tree tem2 = gimple_build (&stmts, loc, BIT_AND_EXPR, type, op2, tem1);
+ tree tem3 = gimple_build (&stmts, loc, BIT_IOR_EXPR, type, tem0, tem2);
+ gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT);
+ return gimple_build_assign (lhs, tem3);
+ }
+
gcc_assert (!COMPARISON_CLASS_P (op0));
if (TREE_CODE (op0) == SSA_NAME)
{
cmp_op_mode = TYPE_MODE (TREE_TYPE (op0a));
unsignedp = TYPE_UNSIGNED (TREE_TYPE (op0a));
-
gcc_assert (known_eq (GET_MODE_NUNITS (mode),
GET_MODE_NUNITS (cmp_op_mode)));
{
gimple *g = gimple_expand_vec_cond_expr (&gsi,
&vec_cond_ssa_name_uses);
-
if (g != NULL)
{
tree lhs = gimple_assign_lhs (gsi_stmt (gsi));
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 --param=max-unswitch-insns=1024" } */
+/* { dg-additional-options "-mavx512vl" { target x86_64-*-* i?86-*-* } } */
+
+int bad_odd_rows_0_0, rows_bad_row1, rows_bad_group_okay, calc_rows_row2;
+
+int
+rows_bad() {
+ int i, in_zeroes;
+ char block;
+ i = 0;
+ for (; i < 5; i++)
+ if (rows_bad_row1 & i)
+ in_zeroes = 0;
+ else {
+ if (!in_zeroes)
+ in_zeroes = 1;
+ if (block & 1)
+ rows_bad_group_okay = 1;
+ }
+ if (in_zeroes)
+ return rows_bad_group_okay;
+}
+
+void
+calc_rows() {
+ for (; calc_rows_row2; calc_rows_row2++) {
+ rows_bad();
+ bad_odd_rows_0_0 = rows_bad();
+ }
+}