[Python-Dev] cpython: Mirco-optimizations to reduce register spills and reloads observed on CLANG and

Serhiy Storchaka storchaka at gmail.com
Mon Feb 9 21:27:36 CET 2015


On 09.02.15 14:48, raymond.hettinger wrote:
> https://hg.python.org/cpython/rev/dc820b44ce21
> changeset:   94572:dc820b44ce21
> user:        Raymond Hettinger <python at rcn.com>
> date:        Mon Feb 09 06:48:29 2015 -0600
> summary:
>    Mirco-optimizations to reduce register spills and reloads observed on CLANG and GCC.
>
> files:
>    Objects/setobject.c |  6 ++++--
>    1 files changed, 4 insertions(+), 2 deletions(-)
>
>
> diff --git a/Objects/setobject.c b/Objects/setobject.c
> --- a/Objects/setobject.c
> +++ b/Objects/setobject.c
> @@ -84,8 +84,9 @@
>                   return set_lookkey(so, key, hash);
>               if (cmp > 0)                                          /* likely */
>                   return entry;
> +            mask = so->mask;                 /* help avoid a register spill */

Could you please explain in more details what this line do? The mask 
variable is actually constant and so->mask isn't changed in this loop.




More information about the Python-Dev mailing list