def test_pystone(): from rpython.translator.goal.targetrpystonex import make_target_definition entrypoint, _, _ = make_target_definition(10) def heuristic(graph): for block in graph.iterblocks(): for op in block.operations: if op.opname in ('malloc',): return inline.inlining_heuristic(graph) return sys.maxint, False # does not crash t, graph = rtype(entrypoint, [int]) total0 = preparation(t, t.graphs, heuristic=heuristic) total = clever_inlining_and_malloc_removal(t) assert total in (6, 7) # XXX total0 appears to vary
def test_count_vars_big(): from rpython.translator.goal.targetrpystonex import make_target_definition from rpython.translator.backendopt.all import backend_optimizations entrypoint, _, _ = make_target_definition(10) t = rtype(entrypoint, [int]) backend_optimizations(t) # does not crash rel = relevant_gcvars(t) print rel print sum(rel) / float(len(rel)), max(rel), min(rel) rel = relevant_gcvars(t, filter_for_nongcptr) print rel print sum(rel) / float(len(rel)), max(rel), min(rel)
def test_pystone(): from rpython.translator.goal.targetrpystonex import make_target_definition entrypoint, _, _ = make_target_definition(10) def heuristic(graph): for block in graph.iterblocks(): for op in block.operations: if op.opname in ('malloc',): return inline.inlining_heuristic(graph) return sys.maxint, False # does not crash t, graph = rtype(entrypoint, [int]) total0 = preparation(t, t.graphs, heuristic=heuristic) total = clever_inlining_and_malloc_removal(t) assert total == 6 # XXX total0 appears to vary
def test_big(): from rpython.translator.goal.targetrpystonex import make_target_definition entrypoint, _, _ = make_target_definition(10) # does not crash t, adi, graph = build_adi(entrypoint, [int])
from rpython.translator.goal import targetrpystonex LOOPS = 2000000 # __________ Entry point __________ # _____ Define and setup target _____ # _____ Run translated _____ (entry_point, target, run) = targetrpystonex.make_target_definition(LOOPS) def get_llinterp_args(): return [1]