[pypy-svn] r37634 - pypy/dist/pypy/jit/codegen/i386

arigo at codespeak.net arigo at codespeak.net
Tue Jan 30 20:41:30 CET 2007


Author: arigo
Date: Tue Jan 30 20:41:26 2007
New Revision: 37634

Modified:
   pypy/dist/pypy/jit/codegen/i386/regalloc.py
Log:
This caused each comparison operation to think it was clobbering its own
result and insert a copy of itself.  We got everywhere two identical
comparison instructions in a row.  Very useful.


Modified: pypy/dist/pypy/jit/codegen/i386/regalloc.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/i386/regalloc.py	(original)
+++ pypy/dist/pypy/jit/codegen/i386/regalloc.py	Tue Jan 30 20:41:26 2007
@@ -92,7 +92,7 @@
     def using_cc(self, v):
         assert isinstance(v, Operation)
         assert 0 <= v.cc_result < INSN_JMP
-        if self.need_var_in_cc is not None:
+        if self.need_var_in_cc is not None and self.need_var_in_cc is not v:
             self.save_cc()
         self.need_var_in_cc = v
 
@@ -103,7 +103,8 @@
         self.operationindex = len(operations)
         for i in range(len(operations)-1, -1, -1):
             v = operations[i]
-            if self.need_var_in_cc is not None and v.clobbers_cc:
+            if (self.need_var_in_cc is not None and
+                self.need_var_in_cc is not v and v.clobbers_cc):
                 self.save_cc()
             kind = v.result_kind
             if kind == RK_WORD:



More information about the Pypy-commit mailing list