[Bug target/80819] [6/7/8 regression] Useless store to the stack in _mm_set_epi64x with SSE4 -mno-avx

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 28 13:51:00 GMT 2017


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uros at gcc dot gnu.org,
                   |                            |vmakarov at gcc dot gnu.org

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The dead stores are created during LRA, e.g. with -mtune=haswell we get:
(insn 3 5 4 2 (set (mem/c:DI (plus:DI (reg/f:DI 7 sp)
                (const_int -16 [0xfffffffffffffff0])) [2 %sfp+-8 S8 A64])
        (reg:DI 4 si [ b ])) "pr80819.c":2 85 {*movdi_internal}
     (nil))
(note 4 3 17 2 NOTE_INSN_FUNCTION_BEG)
(insn 17 4 19 2 (set (reg:DI 21 xmm0 [91])
        (reg/v:DI 5 di [orig:88 a ] [88])) "include/emmintrin.h":591 85
{*movdi_internal}
     (nil))
(note 19 17 20 2 NOTE_INSN_DELETED)
(note 20 19 7 2 NOTE_INSN_DELETED)
(insn 7 20 12 2 (set (reg:V2DI 21 xmm0 [91])
        (vec_concat:V2DI (reg:DI 21 xmm0 [91])
            (mem/c:DI (plus:DI (reg/f:DI 7 sp)
                    (const_int -16 [0xfffffffffffffff0])) [2 %sfp+-8 S8 A64])))
"include/emmintrin.h":591 3738 {vec_concatv2di}
     (nil))
That is weird, because vec_concatv2di has:
(define_insn "vec_concatv2di"
  [(set (match_operand:V2DI 0 "register_operand"
          "=Yr,*x,x ,v ,Yi,v ,x    ,x,v ,x,x,v")
        (vec_concat:V2DI
          (match_operand:DI 1 "nonimmediate_operand"
          "  0, 0,x ,Yv,r ,vm,?!*Yn,0,Yv,0,0,v")
          (match_operand:DI 2 "vector_move_operand"
          "*rm,rm,rm,rm,C ,C ,C ,x,Yv,x,m,m")))]
constraints, so if it is able to reload the first vec_concat operand into the
destination register, why doesn't it pick the alternative (=Yr,0,*rm) or
(=*x,0,rm)?  Is that because of the asterisks?
Shouldn't we help RA and have an alternative with (=Yi,r,r) guarded with x64
isa that would be split into movd + pinsrq?


More information about the Gcc-bugs mailing list