* @author Christoph Mallon
* @version $Id: $
*/
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
#include "iroptimize.h"
-#include "array.h"
+#include "array_t.h"
#include "debug.h"
#include "ircons.h"
#include "irgraph.h"
#include "irdump.h"
#include "irflag_t.h"
#include "irprintf.h"
+#include "irpass.h"
#if +0
#define OPTIMISE_LOAD_AFTER_LOAD
size_t npreds = get_Block_n_cfgpreds(end_block);
size_t i;
- unfinished_phis = xmalloc(sizeof(*unfinished_phis) * count_addrs);
+ unfinished_phis = XMALLOCN(ir_node, count_addrs);
for (i = 0; i < count_addrs; i++) {
unfinished_phis[i] = NULL;
}
#endif
+#if 0
static void AddSyncPreds(ir_nodeset_t* preds, ir_node* sync)
{
size_t n = get_Sync_n_preds(sync);
}
}
-#if 0
static void NormaliseSync(ir_node* node, void* env)
{
ir_nodeset_t preds;
}
n = ir_nodeset_size(&pi.user_mem);
- if (n != 0) { /* nothing happend otherwise */
+ if (n != 0) { /* nothing happened otherwise */
ir_graph *irg = current_ir_graph;
ir_node *sync;
ir_node **in;
in[i++] = p;
}
assert(i == n);
- sync = new_r_Sync(irg, block, n, in);
+ sync = new_r_Sync(block, n, in);
exchange(proj, sync);
assert(pn_Load_M == pn_Store_M);
- proj = new_r_Proj(irg, block, mem_op, mode_M, pn_Load_M);
+ proj = new_r_Proj(block, mem_op, mode_M, pn_Load_M);
set_Sync_pred(sync, 0, proj);
n = ir_nodeset_size(&pi.this_mem);
in[i++] = p;
}
assert(i == n);
- sync = new_r_Sync(irg, block, n, in);
+ sync = new_r_Sync(block, n, in);
}
set_memop_mem(mem_op, sync);
}
//optimize_graph_df(irg);
//irg_walk_graph(irg, NormaliseSync, NULL, NULL);
}
+
+ir_graph_pass_t *opt_sync_pass(const char *name)
+{
+ return def_graph_pass(name ? name : "opt_sync", opt_sync);
+}