#include "iroptimize.h" /* optimize ir by reassociation */
#include "ircgopt.h" /* Optimizations based on interprocedural graph */
#include "iropt.h"
+#include "irpass.h" /* Pass management */
/* Lowering */
#include "lowering.h" /* lowering of different calls parameters, intrinsic calls, double word types, high-level constructs */
*/
void combo(ir_graph *irg);
+/**
+ * Creates an ir_graph pass for combo.
+ *
+ * @param name the name of this pass or NULL
+ * @param verify should this pass be verified?
+ * @param dump should this pass result be dumped?
+ *
+ * @return the newly created ir_graph pass
+ */
+ir_graph_pass_t *combo_pass(const char *name, int verify, int dump);
+
/** Inlines all small methods at call sites where the called address comes
* from a SymConst node that references the entity representing the called
* method.
const char *name,
int verify,
int dump,
- i_record *list, int length);
+ i_record *list, int length, int part_block_used);
/**
* A mapper for the integer/float absolute value: type abs(type v).
};
/**
- * Wrapper for running lower_intrinsics() as an irprog pass.
+ * Wrapper for running lower_intrinsics() as an ir_prog pass.
*/
static int pass_wrapper(ir_prog *irp, void *context)
{
} /* pass_wrapper */
/**
- * Creates an irprog pass for lower_intrinsics.
+ * Creates an ir_prog pass for lower_intrinsics.
*
* @param name the name of this pass or NULL
* @param verify should this pass be verified?
const char *name,
int verify,
int dump,
- i_record *list, int length)
+ i_record *list, int length, int part_block_used)
{
struct pass_t *pass = xmalloc(sizeof(*pass) + (length-1) * sizeof(pass->list[0]));
INIT_LIST_HEAD(&pass->pass.list);
+ memcpy(pass->list, list, sizeof(list[0]) * length);
+ pass->length = length;
+ pass->part_block_used = part_block_used;
+
return &pass->pass;
} /* lower_intrinsics_pass*/
#include "irgraph_t.h"
#include "irnode_t.h"
#include "iropt_t.h"
+#include "irpass_t.h"
#include "irgwalk.h"
#include "irop.h"
#include "irouts.h"
set_value_of_func(NULL);
current_ir_graph = rem;
} /* combo */
+
+/**
+ * Wrapper for running combo() as an ir_graph pass.
+ */
+static int pass_wrapper(ir_graph *irg, void *context) {
+ (void)context;
+ combo(irg);
+ /* combo is a fix-point iteration */
+ return 0;
+} /* pass_wrapper */
+
+/* Creates an ir_graph pass for combo. */
+ir_graph_pass_t *combo_pass(const char *name, int verify, int dump) {
+ struct ir_graph_pass_t *pass = XMALLOCZ(ir_graph_pass_t);
+
+ pass->kind = k_ir_prog_pass;
+ pass->run_on_irg = pass_wrapper;
+ pass->context = pass;
+ pass->name = name ? name : "combo";
+ pass->verify = verify != 0;
+ pass->dump = dump != 0;
+
+ INIT_LIST_HEAD(&pass->list);
+
+ return pass;
+} /* combo_pass */