[pypy-svn] r20843 - in pypy/dist/pypy/jit: . test
cfbolz at codespeak.net
cfbolz at codespeak.net
Wed Dec 7 16:39:10 CET 2005
Author: cfbolz
Date: Wed Dec 7 16:39:09 2005
New Revision: 20843
Modified:
pypy/dist/pypy/jit/llabstractinterp.py
pypy/dist/pypy/jit/test/test_llabstractinterp.py
Log:
(cfbolz, arigo, pedronis around)
normalizing links to the return block.
Modified: pypy/dist/pypy/jit/llabstractinterp.py
==============================================================================
--- pypy/dist/pypy/jit/llabstractinterp.py (original)
+++ pypy/dist/pypy/jit/llabstractinterp.py Wed Dec 7 16:39:09 2005
@@ -121,11 +121,19 @@
def applyhint(self, args_a, origblock):
result_a = []
- for a, origv in zip(args_a, origblock.inputargs):
- if origv in self.hints:
- # use the hint, ignore the source binding
- a = LLConcreteValue(self.hints[origv])
- result_a.append(a)
+ if origblock.operations == ():
+ # make sure args_s does *not* contain LLConcreteValues
+ for a in args_a:
+ if isinstance(a, LLConcreteValue):
+ a = LLRuntimeValue(orig_v=a.getvarorconst())
+ result_a.append(a)
+ else:
+ # apply the hints to make more LLConcreteValues
+ for a, origv in zip(args_a, origblock.inputargs):
+ if origv in self.hints:
+ # use the hint, ignore the source binding
+ a = LLConcreteValue(self.hints[origv])
+ result_a.append(a)
return result_a
def schedule(self, args_a, origblock):
@@ -156,7 +164,7 @@
try:
self.flowin(state)
except GotReturnValue, e:
- assert e.returnstate is returnstate # XXX
+ assert e.returnstate is returnstate
def flowin(self, state):
# flow in the block
Modified: pypy/dist/pypy/jit/test/test_llabstractinterp.py
==============================================================================
--- pypy/dist/pypy/jit/test/test_llabstractinterp.py (original)
+++ pypy/dist/pypy/jit/test/test_llabstractinterp.py Wed Dec 7 16:39:09 2005
@@ -61,3 +61,10 @@
assert op.args[1].concretetype == lltype.Signed
assert len(graph2.startblock.exits) == 1
assert graph2.startblock.exits[0].target is graph2.returnblock
+
+def test_simple2():
+ def ll_function(x, y):
+ return x + y
+
+ graph2, insns = abstrinterp(ll_function, [6, 42], [0, 1])
+ assert not insns
More information about the Pypy-commit
mailing list