[Bug target/83008] [performance] Is it better to avoid extra instructions in data passing between loops?

rguenther at suse dot de gcc-bugzilla@gcc.gnu.org
Mon Nov 20 09:41:00 GMT 2017


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

--- Comment #4 from rguenther at suse dot de <rguenther at suse dot de> ---
On Sun, 19 Nov 2017, hubicka at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83008
> 
> Jan Hubicka <hubicka at gcc dot gnu.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|UNCONFIRMED                 |NEW
>    Last reconfirmed|                            |2017-11-19
>      Ever confirmed|0                           |1
> 
> --- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
> I now get fir first loop:
> 
> 
> a.c:6:5: note: Cost model analysis:                                             
>   Vector inside of loop cost: 1120                                              
>   Vector prologue cost: 0                                                       
>   Vector epilogue cost: 0                                                       
>   Scalar iteration cost: 328                                                    
>   Scalar outside cost: 0                                                        
>   Vector outside cost: 0                                                        
>   prologue iterations: 0                                                        
>   epilogue iterations: 0                                                        
>   Calculated minimum iters for profitability: 0                                 
> a.c:6:5: note:   Runtime profitability threshold = 4                            
> a.c:6:5: note:   Static estimate profitability threshold = 4                    
> 
> For second lop I get:
> 
> a.c:20:5: note: type of def: internal                                           
> a.c:20:5: note: mark relevant 1, live 0: sum.0_60 = (unsigned int) sum_102;     
> a.c:20:5: note: worklist: examine stmt: sum.0_60 = (unsigned int) sum_102;      
> a.c:20:5: note: vect_is_simple_use: operand sum_102                             
> a.c:20:5: note: def_stmt: sum_102 = PHI <0(6), sum_75(7)>                       
> a.c:20:5: note: type of def: unknown                                            
> a.c:20:5: note: Unsupported pattern.                                            
> a.c:20:5: note: not vectorized: unsupported use in stmt.                        
> a.c:20:5: note: unexpected pattern.                               
> 
> Is it really that hard to sum values in vector?              

The issue is the vectorizer doesn't currently handle conversions:

t.c:20:5: note: Analyze phi: sum_102 = PHI <0(6), sum_75(7)>
t.c:20:5: note: reduction: not commutative/associative: sum_75 = (int) 
_61;

I have patches to fix that though.  Sitting somewhere...  see PR65930.


More information about the Gcc-bugs mailing list