Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations in 11 functions
From: Leon Romanovsky
Date: Fri Jan 15 2016 - 10:59:49 EST
On Fri, Jan 15, 2016 at 04:26:36PM +0100, SF Markus Elfring wrote:
> >> Would you like to clarify any measurable effects around the implementation
> >> detail when various variables will only be initialised immediately
> >> before they will be read again?
> >
> > Compiler will drop this variable initialization by itself because
> > there are no reads between this variable initialization and write.
>
> Which compiler variants would you to take into account for such an use case?
GCC supported it before 1999 when I saw it first time. My assumption
that in 2016 all compilers are doing such optimization now.
I would be glad to hear an example of modern compiler which doesn't
support this simple optimization.
>
>
> > I recommend you to take a look on the assembly code and ensure it
> > by yourself.
>
> Will any configuration parameters and command arguments become relevant
> to improve also a corresponding software comparison?
Please suggest us, you are proposing this change, and not me.
>
>
> > The proposed change won't affect performance at all.
>
> Will unneeded variable assignments be really optimised away by default?
Yes
>
>
> By the way:
> Will a small source code reduction matter also a bit here?
If you are interested in saving space of one latter, you need to take into
account git database increase, do you?
>
> Regards,
> Markus