Author: Maciej Fijalkowski <[email protected]>
Branch: numpypy-axisops
Changeset: r51303:54af8d89c99e
Date: 2012-01-14 15:30 +0200
http://bitbucket.org/pypy/pypy/changeset/54af8d89c99e/
Log: kill some dead code
diff --git a/pypy/jit/metainterp/history.py b/pypy/jit/metainterp/history.py
--- a/pypy/jit/metainterp/history.py
+++ b/pypy/jit/metainterp/history.py
@@ -1003,16 +1003,16 @@
return insns
def check_simple_loop(self, expected=None, **check):
- # Usefull in the simplest case when we have only one trace ending with
- # a jump back to itself and possibly a few bridges ending with finnish.
- # Only the operations within the loop formed by that single jump will
- # be counted.
+ """ Usefull in the simplest case when we have only one trace ending
with
+ a jump back to itself and possibly a few bridges.
+ Only the operations within the loop formed by that single jump will
+ be counted.
+ """
loops = self.get_all_loops()
assert len(loops) == 1
loop = loops[0]
jumpop = loop.operations[-1]
assert jumpop.getopnum() == rop.JUMP
- assert self.check_resops(jump=1)
labels = [op for op in loop.operations if op.getopnum() == rop.LABEL]
targets = [op._descr_wref() for op in labels]
assert None not in targets # TargetToken was freed, give up
diff --git a/pypy/module/micronumpy/interp_iter.py
b/pypy/module/micronumpy/interp_iter.py
--- a/pypy/module/micronumpy/interp_iter.py
+++ b/pypy/module/micronumpy/interp_iter.py
@@ -66,9 +66,6 @@
def done(self):
return self.offset == self.size
-def view_iter_from_arr(arr):
- return ViewIterator(arr.start, arr.strides, arr.backstrides, arr.shape)
-
class ViewIterator(BaseIterator):
def __init__(self, start, strides, backstrides, shape):
self.offset = start
diff --git a/pypy/module/micronumpy/interp_numarray.py
b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -9,7 +9,7 @@
from pypy.tool.sourcetools import func_with_new_name
from pypy.rlib.rstring import StringBuilder
from pypy.module.micronumpy.interp_iter import ArrayIterator, OneDimIterator,\
- view_iter_from_arr, SkipLastAxisIterator, AxisIterator
+ SkipLastAxisIterator
numpy_driver = jit.JitDriver(
greens=['shapelen', 'sig'],
diff --git a/pypy/module/micronumpy/test/test_zjit.py
b/pypy/module/micronumpy/test/test_zjit.py
--- a/pypy/module/micronumpy/test/test_zjit.py
+++ b/pypy/module/micronumpy/test/test_zjit.py
@@ -127,17 +127,14 @@
def test_axissum(self):
result = self.run("axissum")
assert result == 30
- self.check_simple_loop({\
- 'setarrayitem_gc': 1,
- 'getarrayitem_gc': 5,
- 'getinteriorfield_raw': 1,
- 'arraylen_gc': 2,
+ self.check_simple_loop({'getinteriorfield_raw': 2,
+ 'setinteriorfield_raw': 1,
+ 'arraylen_gc': 1,
'guard_true': 1,
- 'int_sub': 1,
'int_lt': 1,
'jump': 1,
'float_add': 1,
- 'int_add': 2,
+ 'int_add': 3,
})
def define_prod():
@@ -218,9 +215,9 @@
# This is the sum of the ops for both loops, however if you remove the
# optimization then you end up with 2 float_adds, so we can still be
# sure it was optimized correctly.
- self.check_resops({'setinteriorfield_raw': 4, 'getfield_gc': 26,
+ self.check_resops({'setinteriorfield_raw': 4, 'getfield_gc': 22,
'getarrayitem_gc': 4, 'getarrayitem_gc_pure': 2,
- 'getfield_gc_pure': 4,
+ 'getfield_gc_pure': 8,
'guard_class': 8, 'int_add': 8, 'float_mul': 2,
'jump': 2, 'int_ge': 4,
'getinteriorfield_raw': 4, 'float_add': 2,
@@ -349,9 +346,8 @@
assert result == 11.0
self.check_trace_count(1)
self.check_simple_loop({'getinteriorfield_raw': 2, 'float_add': 1,
- 'setinteriorfield_raw': 1, 'int_add': 3,
- 'int_lt': 1, 'guard_true': 1, 'jump': 1,
- 'arraylen_gc': 3})
+ 'setinteriorfield_raw': 1, 'int_add': 2,
+ 'int_eq': 1, 'guard_false': 1, 'jump': 1})
def define_virtual_slice():
return """
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit