Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1310235

Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations in 11 functions

From Leon Romanovsky <leon@leon.nu>
Newsgroups linux.kernel
Subject Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations in 11 functions
Date 2016-01-15 17:00 +0100
Message-ID <qReX9-8dT-19@gated-at.bofh.it> (permalink)
References (3 earlier) <qQUc2-1S2-17@gated-at.bofh.it> <qRcBY-6DV-23@gated-at.bofh.it> <qRe14-7zo-13@gated-at.bofh.it> <qReaL-7SU-49@gated-at.bofh.it> <qReu6-80G-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/6] InfiniBand-ocrdma: Fine-tuning for some function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-14 18:20 +0100
  [PATCH v3 1/6] InfiniBand-ocrdma: One jump label less in  ocrdma_alloc_ucontext_pd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-14 18:40 +0100
  [PATCH v3 3/6] InfiniBand-ocrdma: Returning only value constants in  ocrdma_qp_state_change() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-14 18:50 +0100
  [PATCH v3 2/6] InfiniBand-ocrdma: Delete unnecessary variable  initialisations in 11 functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-14 18:50 +0100
    Re: [PATCH v3 2/6] InfiniBand-ocrdma: Delete unnecessary variable  initialisations in 11 functions Leon Romanovsky <leon@leon.nu> - 2016-01-15 14:30 +0100
      Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations in  11 functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-15 16:00 +0100
        Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations  in 11 functions Leon Romanovsky <leon@leon.nu> - 2016-01-15 16:10 +0100
          Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations in  11 functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-15 16:30 +0100
            Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations  in 11 functions Leon Romanovsky <leon@leon.nu> - 2016-01-15 17:00 +0100
              Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations  in 11 functions Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-15 17:20 +0100
              Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations in  11 functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-15 17:30 +0100
                Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations  in 11 functions Leon Romanovsky <leon@leon.nu> - 2016-01-15 18:10 +0100
                Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations  in 11 functions Leon Romanovsky <leon@leon.nu> - 2016-01-15 18:50 +0100
                Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations in  11 functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-15 19:30 +0100
                Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations  in 11 functions Leon Romanovsky <leon@leon.nu> - 2016-01-16 07:20 +0100
                Re: InfiniBand-ocrdma: Delete unnecessary variable initialisations in  11 functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-16 09:40 +0100
  [PATCH v3 4/6] InfiniBand-ocrdma: Return a value from a function call  in _ocrdma_modify_qp() directly SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-14 18:50 +0100
  [PATCH v3 6/6] InfiniBand-ocrdma: Delete an unnecessary variable in  ocrdma_dealloc_pd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-14 19:00 +0100
  [PATCH v3 5/6] InfiniBand-ocrdma: Returning only value constants in  ocrdma_resize_cq() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-14 19:00 +0100

csiph-web