[pypy-svn] r17520 - in pypy/dist/pypy/translator: . llvm

ericvrp at codespeak.net ericvrp at codespeak.net
Tue Sep 13 11:49:41 CEST 2005


Author: ericvrp
Date: Tue Sep 13 11:49:40 2005
New Revision: 17520

Modified:
   pypy/dist/pypy/translator/backendoptimization.py
   pypy/dist/pypy/translator/llvm/build_llvm_module.py
   pypy/dist/pypy/translator/llvm/funcnode.py
Log:
* changed gcc optimization flags, becuase -O3 crashes on some machines (snake...)

* using more backendoptimizations, but SSI_to_SSA is not working for LLVM backend,
  so made optz optional. Hoping to use remove_simple_mallocs and inlining.



Modified: pypy/dist/pypy/translator/backendoptimization.py
==============================================================================
--- pypy/dist/pypy/translator/backendoptimization.py	(original)
+++ pypy/dist/pypy/translator/backendoptimization.py	Tue Sep 13 11:49:40 2005
@@ -573,13 +573,19 @@
 
 # ____________________________________________________________
 
-def backend_optimizations(graph):
-    remove_same_as(graph)
-    eliminate_empty_blocks(graph)
+def backend_optimizations(graph, opt_remove_same_as=True,
+                                 opt_SSI_to_SSA=True,
+                                 opt_eliminate_empty_blocks=True,
+                                 opt_remove_simple_mallocs=True):
+    if opt_remove_same_as:
+        remove_same_as(graph)
+    if opt_eliminate_empty_blocks:
+        eliminate_empty_blocks(graph)
     checkgraph(graph)
-    SSI_to_SSA(graph)
+    if opt_SSI_to_SSA:
+        SSI_to_SSA(graph)
     #checkgraph(graph)
-    if remove_simple_mallocs(graph):
+    if opt_remove_simple_mallocs and remove_simple_mallocs(graph):
         transform_dead_op_vars(graph)   # typical after malloc removal
         checkgraph(graph)
 

Modified: pypy/dist/pypy/translator/llvm/build_llvm_module.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/build_llvm_module.py	(original)
+++ pypy/dist/pypy/translator/llvm/build_llvm_module.py	Tue Sep 13 11:49:40 2005
@@ -95,7 +95,7 @@
         cmds.append("llc %s %s.bc -march=c -f -o %s.c" % (genllvm.exceptionpolicy.llc_options(), b, b))
         if exe_name:
             #XXX TODO: use CFLAGS when available
-            cmds.append("gcc %s.c -c -O3 -pipe" % (b,))
+            cmds.append("gcc %s.c -c -O2 -fomit-frame-pointer -pipe" % (b,))
             cmds.append("gcc %s.o %s -lm -ldl -pipe -o %s" % (b, gc_libs, exe_name))
         source_files.append("%s.c" % b)
 

Modified: pypy/dist/pypy/translator/llvm/funcnode.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/funcnode.py	(original)
+++ pypy/dist/pypy/translator/llvm/funcnode.py	Tue Sep 13 11:49:40 2005
@@ -2,7 +2,7 @@
 from pypy.objspace.flow.model import Block, Constant, Variable, Link
 from pypy.objspace.flow.model import flatten, mkentrymap, traverse, last_exception
 from pypy.rpython import lltype
-from pypy.translator.backendoptimization import remove_same_as 
+from pypy.translator.backendoptimization import backend_optimizations
 from pypy.translator.unsimplify import remove_double_links                     
 from pypy.translator.llvm.node import LLVMNode, ConstantLLVMNode
 from pypy.translator.llvm.opwriter import OpWriter
@@ -38,7 +38,7 @@
         self.value = value
         self.ref   = self.make_ref('%pypy_', value.graph.name)
         self.graph = value.graph 
-        remove_same_as(self.graph) 
+        backend_optimizations(self.graph, opt_SSI_to_SSA=False)
         remove_double_links(self.db.translator, self.graph) 
 
     def __str__(self):



More information about the Pypy-commit mailing list