becopyopt: Replace is_Reg_Phi() by just is_Phi().
[libfirm] / ir / lower / lower_mode_b.c
index 1a9ecbc..e7dd474 100644 (file)
@@ -1,27 +1,12 @@
 /*
- * Copyright (C) 1995-2011 University of Karlsruhe.  All right reserved.
- *
  * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 University of Karlsruhe.
  */
 
 /**
  * @file
  * @brief       lower mode_b operations to something the backend can handle
  * @author      Matthias Braun, Christoph Mallon
- * @version     $Id$
  */
 #include "config.h"
 
@@ -276,11 +261,10 @@ void ir_lower_mode_b(ir_graph *const irg, ir_mode *const nlowered_mode)
        lowered_mode = nlowered_mode;
 
        /* edges are used by part_block_edges in the ir_create_cond_set variant. */
-       edges_assure(irg);
-       /* part_block_edges can go wrong with tuples present */
-       remove_tuples(irg);
+       assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES
+                                | IR_GRAPH_PROPERTY_NO_TUPLES);
 
-       set_irg_state(irg, IR_GRAPH_STATE_MODEB_LOWERED);
+       add_irg_constraints(irg, IR_GRAPH_CONSTRAINT_MODEB_LOWERED);
        ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK);
 
        needs_lowering = NEW_ARR_F(needs_lowering_t, 0);
@@ -304,10 +288,5 @@ void ir_lower_mode_b(ir_graph *const irg, ir_mode *const nlowered_mode)
 
        DEL_ARR_F(needs_lowering);
 
-       if (n > 0) {
-               /* lowering might create new blocks, so be sure to handle this */
-               clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
-                                  | IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
-               edges_deactivate(irg);
-       }
+       confirm_irg_properties(irg, n > 0 ? IR_GRAPH_PROPERTIES_NONE : IR_GRAPH_PROPERTIES_ALL);
 }