Commit 362c1331 authored by Michael Beck's avatar Michael Beck
Browse files

updated Header

some doxygen comments added
restructured

[r13543]
parent 2cc9db25
...@@ -17,16 +17,12 @@ ...@@ -17,16 +17,12 @@
* PURPOSE. * PURPOSE.
*/ */
/* /**
* Project: libFIRM * @file
* File name: ir/opt/cfopt.c * @brief Control flow optimizations.
* Purpose: control flow optimizations * @author Goetz Lindenmaier, Michael Beck, Sebastian Hack
* Author: * @version $Id$
* Created:
* CVS-ID: $Id$
* Copyright: (c) 1998-2004 Universitt Karlsruhe
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
#endif #endif
......
...@@ -17,25 +17,14 @@ ...@@ -17,25 +17,14 @@
* PURPOSE. * PURPOSE.
*/ */
/*
* Project: libFIRM
* File name: ir/opt/cfopt.h
* Purpose: control flow optimizations
* Author: Goetz Lindenmaier
* Created:
* CVS-ID: $Id$
* Copyright: (c) 1998-2004 Universität Karlsruhe
*/
/** /**
* @file cfopt.h * @file
* * @brief Control flow optimizations.
* Control flow optimization. * @author Goetz Lindenmaier, Michael Beck, Sebastian Hack
* * @version $Id$
* @author Goetz Lindenmaier
*/ */
#ifndef _CFOPT_H_ #ifndef FIRM_OPT_CFOPT_H
#define _CFOPT_H_ #define FIRM_OPT_CFOPT_H
#include "irgraph.h" #include "irgraph.h"
...@@ -55,4 +44,4 @@ ...@@ -55,4 +44,4 @@
*/ */
void optimize_cf(ir_graph *irg); void optimize_cf(ir_graph *irg);
#endif /* _CFOPT_H_ */ #endif /* FIRM_OPT_CFOPT_H */
...@@ -17,14 +17,12 @@ ...@@ -17,14 +17,12 @@
* PURPOSE. * PURPOSE.
*/ */
/* /**
* Project: libFIRM * @file
* File name: ir/opt/cfopt.c * @brief Partial condition evaluation
* Purpose: Partial condition evaluation * @date 10. Sep. 2006
* Author: Christoph Mallon, Matthias Braun * @author Christoph Mallon, Matthias Braun
* Created: 10. Sep. 2006 * @version $Id$
* CVS-ID: $Id$
* Copyright: (c) 1998-2006 Universität Karlsruhe
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
...@@ -400,7 +398,7 @@ static ir_node *find_phi_with_const(ir_node *jump, ir_node *value, condeval_env_ ...@@ -400,7 +398,7 @@ static ir_node *find_phi_with_const(ir_node *jump, ir_node *value, condeval_env_
/** /**
* Block-walker: searchs for the following construct * Block-walker: searches for the following construct
* *
* Const or Phi with constants * Const or Phi with constants
* | * |
...@@ -518,35 +516,40 @@ static void cond_eval(ir_node* block, void* data) ...@@ -518,35 +516,40 @@ static void cond_eval(ir_node* block, void* data)
remove_pred(env.cnst_pred, env.cnst_pos); remove_pred(env.cnst_pred, env.cnst_pos);
// the graph is changed now /* the graph is changed now */
*changed = 1; *changed = 1;
set_irg_doms_inconsistent(irg);
set_irg_extblk_inconsistent(irg);
set_irg_loopinfo_inconsistent(irg);
} }
} }
} }
void opt_cond_eval(ir_graph* irg) void opt_cond_eval(ir_graph* irg)
{ {
int changed; int changed, rerun;
FIRM_DBG_REGISTER(dbg, "firm.opt.condeval"); FIRM_DBG_REGISTER(dbg, "firm.opt.condeval");
DB((dbg, LEVEL_1, "===> Performing condition evaluation on %+F\n", irg)); DB((dbg, LEVEL_1, "===> Performing condition evaluation on %+F\n", irg));
edges_assure(irg);
remove_critical_cf_edges(irg); remove_critical_cf_edges(irg);
normalize_proj_nodes(irg); normalize_proj_nodes(irg);
edges_assure(irg);
set_using_irn_link(irg); set_using_irn_link(irg);
set_using_visited(irg); set_using_visited(irg);
changed = 0;
do { do {
changed = 0; rerun = 0;
irg_block_walk_graph(irg, cond_eval, NULL, &changed); irg_block_walk_graph(irg, cond_eval, NULL, &rerun);
} while(changed); changed |= rerun;
} while (rerun);
if (changed) {
/* control flow changed, some blocks may become dead */
set_irg_doms_inconsistent(irg);
set_irg_extblk_inconsistent(irg);
set_irg_loopinfo_inconsistent(irg);
}
clear_using_visited(irg); clear_using_visited(irg);
clear_using_irn_link(irg); clear_using_irn_link(irg);
......
...@@ -17,11 +17,22 @@ ...@@ -17,11 +17,22 @@
* PURPOSE. * PURPOSE.
*/ */
#ifndef FIRM_COND_EVAL_H /**
#define FIRM_COND_EVAL_H * @file
* @brief Partial condition evaluation
* @author Christoph Mallon, Matthias Braun
* @version $Id$
*/
#ifndef FIRM_OPT_CONDEVAL_H
#define FIRM_OPT_CONDEVAL_H
#include "irgraph.h" #include "firm_types.h"
/**
* Perform partial conditionla evaluation on the given graph.
*
* @param irg the graph
*/
void opt_cond_eval(ir_graph* irg); void opt_cond_eval(ir_graph* irg);
#endif /* FIRM_COND_EVAL_H */ #endif /* FIRM_OPT_CONDEVAL_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment