* src/vm/jit/cfg.c (cfg_remove_root): New symbol.
authorPeter Molnar <pm@complang.tuwien.ac.at>
Tue, 1 Jul 2008 18:44:50 +0000 (20:44 +0200)
committerPeter Molnar <pm@complang.tuwien.ac.at>
Tue, 1 Jul 2008 18:44:50 +0000 (20:44 +0200)
* src/vm/jit/optimizing/ssa.c (ssa): Using cfg_remove_root to remove the artificial BB 0.
* src/vm/jit/optimizing/ssa3.c: Adapted.

src/vm/jit/cfg.c
src/vm/jit/optimizing/ssa.c
src/vm/jit/optimizing/ssa3.c

index 652e200970461fc6d6531c460f30a62cd6935182..da46ee966b02b3beadb2ee23c3391c9a4e7f89dc 100644 (file)
@@ -501,6 +501,21 @@ void cfg_add_root(jitdata *jd) {
        }
 }
 
+void cfg_remove_root(jitdata *jd) {
+       basicblock *root, *zero, *it;
+
+       root = jd->basicblocks;
+       zero = root->next;
+
+       zero->predecessorcount -= 1;
+
+       jd->basicblocks = zero;
+
+       for (it = zero; it; it = it->next) {
+               it->nr -= 1;
+       }
+}
+
 #if defined(ENABLE_SSA)
 
 static void cfg_eliminate_edges_to_unreachable(jitdata *jd);
index 721323e4bb0df7409dca7d2981c95c6da8c458c1..793a6605d4ca8bc86886a0669a687da3bbe057d0 100644 (file)
@@ -133,6 +133,7 @@ void ssa(jitdata *jd) {
                yssa(jd);
        }
        /*pythonpass_run(jd, "foo", "after");*/
+       cfg_remove_root(jd);
        return;
 
        ls = jd->ls;
index 61fed6db95085665d50b136841ac1561b75d649a..d522951997f37f6ec4860a145cd37b9069b51eec 100644 (file)
@@ -50,7 +50,7 @@
 /*#define ELIMINATE_NOP_LOAD_STORE*/
 #define FIXME(x) x
 #define SSA_VERIFY
-#define SSA_VERBOSE 
+/*#define SSA_VERBOSE */
 
 /*
 __attribute__((always_inline))