beverify: remove dominance check
authorMatthias Braun <matze@braunis.de>
Fri, 28 Sep 2012 08:36:04 +0000 (10:36 +0200)
committerMatthias Braun <matze@braunis.de>
Mon, 29 Oct 2012 16:48:56 +0000 (17:48 +0100)
irverify already checks the dominance property

ir/be/bemain.c
ir/be/beverify.c
ir/be/beverify.h

index ec661f1..cfa29dc 100644 (file)
@@ -652,10 +652,8 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                be_timer_push(T_VERIFY);
                if (be_options.verify_option == BE_VERIFY_WARN) {
                        irg_verify(irg, VERIFY_ENFORCE_SSA);
                be_timer_push(T_VERIFY);
                if (be_options.verify_option == BE_VERIFY_WARN) {
                        irg_verify(irg, VERIFY_ENFORCE_SSA);
-                       be_check_dominance(irg);
                } else if (be_options.verify_option == BE_VERIFY_ASSERT) {
                        assert(irg_verify(irg, VERIFY_ENFORCE_SSA) && "irg verification failed");
                } else if (be_options.verify_option == BE_VERIFY_ASSERT) {
                        assert(irg_verify(irg, VERIFY_ENFORCE_SSA) && "irg verification failed");
-                       assert(be_check_dominance(irg) && "Dominance verification failed");
                }
                be_timer_pop(T_VERIFY);
 
                }
                be_timer_pop(T_VERIFY);
 
@@ -688,24 +686,12 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
 
                dump(DUMP_PREPARED, irg, "before-code-selection");
 
 
                dump(DUMP_PREPARED, irg, "before-code-selection");
 
-               if (be_options.verify_option == BE_VERIFY_WARN) {
-                       be_check_dominance(irg);
-               } else if (be_options.verify_option == BE_VERIFY_ASSERT) {
-                       assert(be_check_dominance(irg) && "Dominance verification failed");
-               }
-
                /* perform codeselection */
                be_timer_push(T_CODEGEN);
                if (arch_env->impl->prepare_graph != NULL)
                        arch_env->impl->prepare_graph(irg);
                be_timer_pop(T_CODEGEN);
 
                /* perform codeselection */
                be_timer_push(T_CODEGEN);
                if (arch_env->impl->prepare_graph != NULL)
                        arch_env->impl->prepare_graph(irg);
                be_timer_pop(T_CODEGEN);
 
-               if (be_options.verify_option == BE_VERIFY_WARN) {
-                       be_check_dominance(irg);
-               } else if (be_options.verify_option == BE_VERIFY_ASSERT) {
-                       assert(be_check_dominance(irg) && "Dominance verification failed");
-               }
-
                dump(DUMP_PREPARED, irg, "code-selection");
 
                /* disabled for now, fails for EmptyFor.c and XXEndless.c */
                dump(DUMP_PREPARED, irg, "code-selection");
 
                /* disabled for now, fails for EmptyFor.c and XXEndless.c */
@@ -784,12 +770,10 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                be_timer_push(T_VERIFY);
                if (be_options.verify_option == BE_VERIFY_WARN) {
                        irg_verify(irg, VERIFY_ENFORCE_SSA);
                be_timer_push(T_VERIFY);
                if (be_options.verify_option == BE_VERIFY_WARN) {
                        irg_verify(irg, VERIFY_ENFORCE_SSA);
-                       be_check_dominance(irg);
                        be_verify_schedule(irg);
                        be_verify_register_allocation(irg);
                } else if (be_options.verify_option == BE_VERIFY_ASSERT) {
                        assert(irg_verify(irg, VERIFY_ENFORCE_SSA) && "irg verification failed");
                        be_verify_schedule(irg);
                        be_verify_register_allocation(irg);
                } else if (be_options.verify_option == BE_VERIFY_ASSERT) {
                        assert(irg_verify(irg, VERIFY_ENFORCE_SSA) && "irg verification failed");
-                       assert(be_check_dominance(irg) && "Dominance verification failed");
                        assert(be_verify_schedule(irg) && "Schedule verification failed");
                        assert(be_verify_register_allocation(irg)
                               && "register allocation verification failed");
                        assert(be_verify_schedule(irg) && "Schedule verification failed");
                        assert(be_verify_register_allocation(irg)
                               && "register allocation verification failed");
index 750f5bc..a46446b 100644 (file)
@@ -824,48 +824,6 @@ bool be_verify_register_allocation(ir_graph *new_irg)
 
 /*--------------------------------------------------------------------------- */
 
 
 /*--------------------------------------------------------------------------- */
 
-/**
- * Walker: checks that every predecessors of a node dominates the node.
- */
-static void dom_check(ir_node *irn, void *data)
-{
-       bool *problem_found = (bool*)data;
-
-       if (!is_Block(irn) && irn != get_irg_end(get_irn_irg(irn))) {
-               ir_node *bl = get_nodes_block(irn);
-
-               int n = get_irn_arity(irn);
-               for (int i = 0; i < n; ++i) {
-                       ir_node *op     = get_irn_n(irn, i);
-                       ir_node *def_bl = get_nodes_block(op);
-                       ir_node *use_bl = bl;
-
-                       if (is_Phi(irn))
-                               use_bl = get_Block_cfgpred_block(bl, i);
-
-                       if (get_irn_opcode(use_bl) != iro_Bad
-                            && get_irn_opcode(def_bl) != iro_Bad
-                            && !block_dominates(def_bl, use_bl)) {
-                               ir_fprintf(stderr, "Verify warning: %+F in %+F must dominate %+F for user %+F (%s)\n", op, def_bl, use_bl, irn, get_irg_name(get_irn_irg(op)));
-                               *problem_found = true;
-                       }
-               }
-       }
-}
-
-/* Check, if the SSA dominance property is fulfilled. */
-bool be_check_dominance(ir_graph *irg)
-{
-       bool problem_found = false;
-
-       assure_doms(irg);
-       irg_walk_graph(irg, dom_check, NULL, &problem_found);
-
-       return !problem_found;
-}
-
-/*--------------------------------------------------------------------------- */
-
 typedef struct lv_walker_t {
        be_lv_t *lv;
        void *data;
 typedef struct lv_walker_t {
        be_lv_t *lv;
        void *data;
index adcbe7e..c4a2b29 100644 (file)
@@ -69,13 +69,6 @@ int be_verify_spillslots(ir_graph *irg);
  */
 bool be_verify_register_allocation(ir_graph *irg);
 
  */
 bool be_verify_register_allocation(ir_graph *irg);
 
-/**
- * Check, if the SSA dominance property is fulfilled.
- * @param irg The graph.
- * @return   true if dominance property is fulfilled, false otherwise
- */
-bool be_check_dominance(ir_graph *irg);
-
 /**
  * Check the given liveness information against a freshly computed one.
  */
 /**
  * Check the given liveness information against a freshly computed one.
  */