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

--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> The "simplest" way would be to have separate UNSPECs for all ops (but that
> explodes the number of unspecs I guess).  Currently we get
> 
> (insn 21 20 22 (parallel [
>             (set (reg:V16SF 110)
>                 (vec_merge:V16SF (plus:V16SF (reg:V16SF 111)
>                         (reg:V16SF 112))
>                     (reg:V16SF 113)
>                     (reg:HI 114)))
>             (unspec [
>                     (const_int 9 [0x9])
>                 ] UNSPEC_EMBEDDED_ROUNDING)
>         ])
> "/home/space/rguenther/install/gcc-7.0/lib64/gcc/x86_64-pc-linux-gnu/7.0.0/
> include/avx512fintrin.h":2113 -1
>      (nil))
> 
> and CSE happily looks into parallels, not interpreting the unspec to affect
> the set.

Rightfully so, UNSPECs are regular operations and there is no data dependency
in the above pattern.

So another way would be sth like
> 
> (insn (set (reg:V16SF 110)
>                 (vec_merge:V16SF (plus:V16SF (reg:V16SF 111)
>                         (reg:V16SF 112))
>                     (reg:V16SF 113)
>                     (reg:HI 114))))
> 
> (insn (set (reg:V16SF 110) (unspec [ (reg:V16SF 110) (const_int 9) ]
> UNSPEC_EMBEDDED_ROUNDING) ])
> 
> or merging this "rounding operation" into the operation (around the
> plus, one of its operands or around the merge).

Right, the data dependency needs to be visible somehow or other in the RTL.

Reply via email to