https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99767

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Note, we have already:
      /* Stub out scalar statements that must not survive vectorization.
         Doing this here helps with grouped statements, or statements that
         are involved in patterns.  */
      for (gimple_stmt_iterator gsi = gsi_start_bb (bb);
           !gsi_end_p (gsi); gsi_next (&gsi))
        {
          gcall *call = dyn_cast <gcall *> (gsi_stmt (gsi));
          if (call && gimple_call_internal_p (call, IFN_MASK_LOAD))
            {
              tree lhs = gimple_get_lhs (call);
              if (!VECTOR_TYPE_P (TREE_TYPE (lhs)))
                {
                  tree zero = build_zero_cst (TREE_TYPE (lhs));
                  gimple *new_stmt = gimple_build_assign (lhs, zero);
                  gsi_replace (&gsi, new_stmt, true);
                }
            }
        }
in tree-vect-loop.c.
Perhaps we should handle similarly IFN_COND_* ?
Instead of using zero for those perhaps we could just use the last argument of
those calls (i.e. the ELSE part).

Reply via email to