Author: Maciej Fijalkowski <[email protected]>
Branch: gc_no_cleanup_nursery
Changeset: r73631:539491bcd60f
Date: 2014-09-21 10:31 +0200
http://bitbucket.org/pypy/pypy/changeset/539491bcd60f/
Log: optimize away the trivial case
diff --git a/rpython/jit/backend/llsupport/rewrite.py
b/rpython/jit/backend/llsupport/rewrite.py
--- a/rpython/jit/backend/llsupport/rewrite.py
+++ b/rpython/jit/backend/llsupport/rewrite.py
@@ -212,6 +212,8 @@
o = ResOperation(rop.ARRAYLEN_GC, [v_arr], v_length,
descr=arraydescr)
self.newops.append(o)
+ elif isinstance(v_length, ConstInt) and v_length.getint() == 0:
+ return
o = ResOperation(rop.ZERO_ARRAY, [v_arr, ConstInt(0), v_length], None,
descr=arraydescr)
self.newops.append(o)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit