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

--- Comment #2 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #1)
> I bet IRA is confused by the subregs.
> 
No, I don't think it is the case here.

(insn 19 18 20 4 (parallel [                                                    
            (set (reg:DI 102)                                                   
                (ashift:DI (reg/v:DI 86 [ i ])                                  
                    (const_int 6 [0x6])))                                       
            (clobber (reg:CC 17 flags))                                         
        ]) "b.cc":8:30 592 {*ashldi3_1}                                         
     (expr_list:REG_UNUSED (reg:CC 17 flags)                                    
        (nil)))                                                                 
(insn 20 19 24 4 (set (reg:V16SI 87 [ _21 ])                                    
        (mem:V16SI (plus:DI (reg/v/f:DI 98 [ a ])                               
                (reg:DI 102)) [0 MEM[base: a_14(D), index: _43, offset: 0B]+0
S64 A512])) "/home/vmakarov/build1/gcc-git/64/lib/gcc/x86_64-pc\
-linux-gnu/10.0.1/include/avx512vnniintrin.h":66:51 1324 {movv16si_internal}    
     (expr_list:REG_DEAD (reg:DI 102)                                           
        (nil)))                                                                 
(insn 24 20 26 4 (set (reg:V16SI 103)                                           
        (unspec:V16SI [                                                         
                (subreg:V16SI (reg/v:V8DI 90 [ c0 ]) 0)                         
                (reg:V16SI 87 [ _21 ])                                          
                (reg:V16SI 92 [ _40 ])                                          
            ] UNSPEC_VPMADDUBSWACCSSD))
"/home/vmakarov/build1/gcc-git/64/lib/gcc/x86_64-pc-linux-gnu/10.0.1/include/avx512vnniintrin.h":66:5\
1 5895 {vpdpbusds_v16si}                                                        
     (expr_list:REG_DEAD (reg/v:V8DI 90 [ c0 ])                                 
        (nil)))                                                                 
---->>>>>>(insn 26 24 30 4 (set (reg/v:V8DI 90 [ c0 ])                          
        (subreg:V8DI (reg:V16SI 103) 0))
"/home/vmakarov/build1/gcc-git/64/lib/gcc/x86_64-pc-linux-gnu/10.0.1/include/avx512vnniintrin.h":67:\
22 1327 {movv8di_internal}                                                      
     (nil))                                                                     
(insn 30 26 32 4 (set (reg:V16SI 107)                                           
        (unspec:V16SI [                                                         
                (subreg:V16SI (reg/v:V8DI 83 [ c1 ]) 0)                         
                (reg:V16SI 87 [ _21 ])                                          
                (reg:V16SI 91 [ _39 ])                                          
            ] UNSPEC_VPMADDUBSWACCSSD))
"/home/vmakarov/build1/gcc-git/64/lib/gcc/x86_64-pc-linux-gnu/10.0.1/include/avx512vnniintrin.h":66:5\
1 5895 {vpdpbusds_v16si}                                                        
     (expr_list:REG_DEAD (reg:V16SI 87 [ _21 ])                                 
        (expr_list:REG_DEAD (reg/v:V8DI 83 [ c1 ])                              
            (nil))))                                                            
(insn 32 30 33 4 (set (reg/v:V8DI 83 [ c1 ])                                    
        (subreg:V8DI (reg:V16SI 107) 0))
"/home/vmakarov/build1/gcc-git/64/lib/gcc/x86_64-pc-linux-gnu/10.0.1/include/avx512vnniintrin.h":67:\
22 1327 {movv8di_internal}                                                      
     (nil))                                                                     
(insn 33 32 35 4 (parallel [                                                    
            (set (reg/v:DI 86 [ i ])                                            
                (plus:DI (reg/v:DI 86 [ i ])                                    
                    (const_int 1 [0x1])))                                       
            (clobber (reg:CC 17 flags))                                         
        ]) "b.cc":7:3 186 {*adddi_1}                                            
     (expr_list:REG_UNUSED (reg:CC 17 flags)                                    
        (nil)))                                                                 
(insn 35 33 36 4 (set (reg:CCZ 17 flags)                                        
        (compare:CCZ (reg/v:DI 101 [ count ])                                   
            (reg/v:DI 86 [ i ]))) "b.cc":7:29 12 {*cmpdi_1}                     
     (nil))                                                                     
(jump_insn 36 35 37 4 (set (pc)                                                 
        (if_then_else (ne (reg:CCZ 17 flags)                                    
                (const_int 0 [0]))                                              
            (label_ref:DI 34)                                                   
            (pc))) "b.cc":7:29 736 {*jcc}                                       
     (expr_list:REG_DEAD (reg:CCZ 17 flags)                                     
        (int_list:REG_BR_PROB 955630228 (nil)))                                 
 -> 34)                                                                         
;;  succ:       5 [11.0% (guessed)]  count:105119324 (estimated locally)
(FALLTHRU,LOOP_EXIT)                                                 
;;              4 [89.0% (guessed)]  count:850510901 (estimated locally)
(DFS_BACK)                                                           
;; lr  out       6 [bp] 7 [sp] 16 [argp] 19 [frame] 83 86 90 91 92 98 101 103
107                                                             
;; live  out     6 [bp] 7 [sp] 16 [argp] 19 [frame] 83 86 **90** 91 92 98 101
**103** 107  

For example, 103 and 90 conflict.  LRA can recognize the simple case of pseudos
using the same value and living simulteneously but in this case the both
pseudos live outside BB.

GVN for RA conflict calculation could help it here but it will complicate
already complicated RA.  I tried GVN for the old RA about 15 years ago (there
is some article about this from GCC summit proceedings) but never tried to put
this work into GCC because of mixed results.

The best way to fix is to avoid to generate such code.  But I don't know is it
possible for this case.

Reply via email to