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

raymond.hettinger python-checkins at python.org
Mon Feb 9 13:48:37 CET 2015


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 */
 }
- if (entry->key == dummy && freeslot == NULL)
+ if (entry->hash == -1 && freeslot == NULL)
 freeslot = entry;
 
 if (i + LINEAR_PROBES <= mask) {
@@ -111,8 +112,9 @@
 return set_lookkey(so, key, hash);
 if (cmp > 0)
 return entry;
+ mask = so->mask;
 }
- if (entry->key == dummy && freeslot == NULL)
+ if (entry->hash == -1 && freeslot == NULL)
 freeslot = entry;
 }
 }
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /