Author: Carl Friedrich Bolz <[email protected]>
Branch: regalloc-playground
Changeset: r92200:eeca1d43c304
Date: 2017-08-21 16:32 +0200
http://bitbucket.org/pypy/pypy/changeset/eeca1d43c304/

Log:    move this case to the tests, where it belongs

diff --git a/rpython/jit/backend/llsupport/regalloc.py 
b/rpython/jit/backend/llsupport/regalloc.py
--- a/rpython/jit/backend/llsupport/regalloc.py
+++ b/rpython/jit/backend/llsupport/regalloc.py
@@ -818,8 +818,7 @@
         # the position where the variable is last used. this includes failargs
         # and jumps
         self.last_usage = last_usage
-        if last_real_usage == UNDEF_POS:
-            last_real_usage = last_usage
+
         # last *real* usage, ie as an argument to an operation
         # after last_real_usage and last_usage it does not matter whether the
         # variable is stored on the stack
diff --git a/rpython/jit/backend/llsupport/test/test_regalloc.py 
b/rpython/jit/backend/llsupport/test/test_regalloc.py
--- a/rpython/jit/backend/llsupport/test/test_regalloc.py
+++ b/rpython/jit/backend/llsupport/test/test_regalloc.py
@@ -1,7 +1,8 @@
 import py
 from rpython.jit.metainterp.history import ConstInt, INT, FLOAT
 from rpython.jit.backend.llsupport.regalloc import FrameManager, LinkedList
-from rpython.jit.backend.llsupport.regalloc import RegisterManager as 
BaseRegMan, Lifetime
+from rpython.jit.backend.llsupport.regalloc import RegisterManager as 
BaseRegMan,\
+     Lifetime as RealLifetime, UNDEF_POS
 from rpython.jit.metainterp.resoperation import InputArgInt, InputArgRef,\
      InputArgFloat
 
@@ -11,6 +12,13 @@
 def newrefboxes(count):
     return [InputArgRef() for _ in range(count)]
 
+def Lifetime(definition_pos=UNDEF_POS, last_usage=UNDEF_POS,
+             last_real_usage=UNDEF_POS):
+    if last_real_usage == UNDEF_POS:
+        last_real_usage = last_usage
+    return RealLifetime(definition_pos, last_usage, last_real_usage)
+
+
 def boxes_and_longevity(num):
     res = []
     longevity = {}
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to