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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
My bet is boolean vectors with QI/HImode.  But eventually the vectorizer uses
vector_load on sth not being a vector load as well.  Yeah...

          /* Without looking at the actual initializer a vector of
             constants can be implemented as load from the constant pool.
             ???  We need to pass down stmt_info for a vector type
             even if it points to the wrong stmt.  */
          if (dt == vect_constant_def)
            record_stmt_cost (prologue_cost_vec, 1, vector_load,
                              stmt_info, 0, vect_prologue);

so the stmt vector type is

 <vector_type 0x7ffff6695690
    type <boolean_type 0x7ffff66955e8 public QI
        size <integer_cst 0x7ffff6891dc8 constant 8>
        unit-size <integer_cst 0x7ffff6891de0 constant 1>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff66955e8 precision:1 min <integer_cst 0x7ffff6a8b918 -1> max <integer_cst
0x7ffff6a8b948 0>>
    HI
    size <integer_cst 0x7ffff6891d20 type <integer_type 0x7ffff68a90a8
bitsizetype> constant 128>
    unit-size <integer_cst 0x7ffff6891d38 type <integer_type 0x7ffff68a9000
sizetype> constant 16>
    align:128 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6695690 nunits:16>

as I said.  The stmt we're looking at is

_2 = _1 <= 10;

so for costing the proper vector type would be not the boolean vector type
but the vector type of the operand.

Cost of constant handling in SLP is a hack (somewhat).  Given we're
using the new & shiny cost interface here there's no way to stuff down
the "proper" vector type.  Not passing stmt_info down would make the
constant case work but the external case quite pointless.

As said, you can't expect the "correct" vector type to be passed down
consistently :/

Reply via email to