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

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
On this combiner fails to match:

Failed to match this instruction:
(set (subreg:V4SI (reg:V2DI 101 [ <retval> ]) 0)
    (sign_extend:V4SI (vec_select:V4HI (mem:V8HI (reg:DI 106) [0 *x_3(D)+0 S16
A128])
            (parallel [
                    (const_int 0 [0])
                    (const_int 1 [0x1])
                    (const_int 2 [0x2])
                    (const_int 3 [0x3])
                ]))))

which is 

(define_insn "sse4_1_<code>v4hiv4si2<mask_name>"
  [(set (match_operand:V4SI 0 "register_operand" "=Yr,*x,v")
    (any_extend:V4SI
      (vec_select:V4HI
        (match_operand:V8HI 1 "register_operand" "Yr,*x,v")
        (parallel [(const_int 0) (const_int 1)
               (const_int 2) (const_int 3)]))))]
  "TARGET_SSE4_1 && <mask_avx512vl_condition>"
  "%vpmov<extsuffix>wd\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}"
  [(set_attr "isa" "noavx,noavx,avx")
   (set_attr "type" "ssemov")
   (set_attr "prefix_extra" "1")
   (set_attr "prefix" "orig,orig,maybe_evex")
   (set_attr "mode" "TI")])

(define_insn "*sse4_1_<code>v4hiv4si2<mask_name>_1"
  [(set (match_operand:V4SI 0 "register_operand" "=Yr,*x,v")
    (any_extend:V4SI
      (match_operand:V4HI 1 "memory_operand" "jm,jm,m")))]
  "TARGET_SSE4_1 && <mask_avx512vl_condition>"
  "%vpmov<extsuffix>wd\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}"
  [(set_attr "isa" "noavx,noavx,avx")
   (set_attr "addr" "gpr16,gpr16,*")
   (set_attr "type" "ssemov")
   (set_attr "prefix_extra" "1")
   (set_attr "prefix" "orig,orig,maybe_evex")
   (set_attr "mode" "TI")])

So it seems sse.md expects combiner to be able to simplify the vec_select of
mem into shorter mem, while combiner doesn't do that?

Reply via email to