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

--- Comment #1 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
The canonicalization introduced by r15-6657 make the loop invariant of inner
loop not simlified and caused extra use in the outer loop and regressed
performance.

invariant of inner loop

 761<Invariant Expressions>:                                                    
 762inv_expr 1:     (unsigned long) k_117 * 8 + (unsigned long)
input_array_dims_95(D)                                                          
 763inv_expr 2:     ((unsigned long) k_117 * 8 + (unsigned long)
input_array_dims_95(D)) - (unsigned long) (int) ((unsigned int) k_117 +
4294967294) * 8                                                                 
 764inv_expr 3:     ((unsigned long) k_117 * 8 + (unsigned long)
input_array_dims_95(D)) - (unsigned long) (int) ((unsigned int) k_117 +
4294967295) * 8                                                                 
 765inv_expr 4:     (((unsigned long) k_117 * 8 + (unsigned long)
input_array_dims_95(D)) - (unsigned long) ((unsigned int) k_117 + 4294967295) *
8) + 18446744073709551600                                                       
 766inv_expr 5:     (((unsigned long) k_117 * 8 + (unsigned long)
input_array_dims_95(D)) - (unsigned long) ((unsigned int) k_117 + 4294967295) *
8) + 18446744073709551608  



(k_117 * 8 + xxx) - (k_117 - 1) * 8 is not simplied because of the convert
chain. and it caused extra groups for the outer loop for the intermiediate expr
of those invariant

1012  Use 0.0:                                                                  
1013    At stmt:    _102 = _103 + 4294967295;                                   
1014    At pos:                                                                 
1015    IV struct:                                                              
1016      Type:     unsigned int                                                
1017      Base:     (unsigned int) N_dims_72(D) + 4294967294                    
1018      Step:     4294967295                                                  
1019      Biv:      N                                                           
1020      Overflowness wrto loop niter:     Overflow                            
1021Group 1:                                                                    
1022  Type: GENERIC                                                             
1023  Use 1.0:                                                                  
1024    At stmt:    _130 = _131 + _132;                                         
1025    At pos:                                                                 
1026    IV struct:                                                              
1027      Type:     unsigned long                                               
1028      Base:     ((unsigned long) N_dims_72(D) * 8 + (unsigned long)
input_array_dims_95(D)) + 18446744073709551608                                  
1029      Step:     18446744073709551608                                        
1030      Object:   (void *) input_array_dims_95(D)                             
1031      Biv:      N                                                           
1032      Overflowness wrto loop niter:     Overflow                            
1033Group 2:                                                   
1012  Use 0.0:                                                                  
1013    At stmt:    _102 = _103 + 4294967295;                                   
1014    At pos:                                                                 
1015    IV struct:                                                              
1016      Type:     unsigned int                                                
1017      Base:     (unsigned int) N_dims_72(D) + 4294967294                    
1018      Step:     4294967295                                                  
1019      Biv:      N                                                           
1020      Overflowness wrto loop niter:     Overflow                            
1021Group 1:                                                                    
1022  Type: GENERIC                                                             
1023  Use 1.0:                                                                  
1024    At stmt:    _130 = _131 + _132;                                         
1025    At pos:                                                                 
1026    IV struct:                                                              
1027      Type:     unsigned long                                               
1028      Base:     ((unsigned long) N_dims_72(D) * 8 + (unsigned long)
input_array_dims_95(D)) + 18446744073709551608                                  
1029      Step:     18446744073709551608                                        
1030      Object:   (void *) input_array_dims_95(D)                             
1031      Biv:      N                                                           
1032      Overflowness wrto loop niter:     Overflow                            
1033Group 2:

Reply via email to