Massive performance regression from switching to gcc 4.5

Eric Botcazou ebotcazou@adacore.com
Fri Jun 25 09:08:00 GMT 2010


> Minus whitespace changes it seems to be
>
> !           if (lhs_free && (is_gimple_reg (rhs) ||
> is_gimple_min_invariant (rhs)))
>               rhs_free = true;
>
> vs.
>
> !           if (lhs_free
> !               && (is_gimple_reg (rhs)
> !                   || !is_gimple_reg_type (TREE_TYPE (rhs))
> !                   || is_gimple_min_invariant (rhs)))
>               rhs_free = true;
>
> so the stmt is likely being eliminated if either the LHS or the RHS is
> based on a parameter and the other side is a register or an invariant.  You
> change that to also discount aggregate stores/loads to/from parameters to
> be free.

There is also the counterpart for the RHS:

! 	    if (rhs_free && is_gimple_reg (lhs))
  	      lhs_free = true;
vs

! 	    if (rhs_free
! 		&& (is_gimple_reg (lhs)
! 		    || !is_gimple_reg_type (TREE_TYPE (lhs))))
  	      lhs_free = true;

> Which you could have simplified to just say
>
>   if (lhs_free || rhs_free)
>     return true;
>
> and drop the code you are changing.

I don't think so, compare your version and mine for scalar stores/loads 
from/to parameters or return values.

-- 
Eric Botcazou



More information about the Gcc mailing list