+
+typedef struct pass_t {
+ ir_prog_pass_t pass;
+ float threshold;
+} pass_t;
+
+/**
+ * Wrapper to run proc_cloning() as an ir_prog pass.
+ */
+static int proc_cloning_wrapper(ir_prog *irp, void *context)
+{
+ pass_t *pass = (pass_t*)context;
+
+ (void)irp;
+ proc_cloning(pass->threshold);
+ return 0;
+}
+
+/* create a ir_prog pass */
+ir_prog_pass_t *proc_cloning_pass(const char *name, float threshold)
+{
+ pass_t *pass = XMALLOCZ(pass_t);
+
+ pass->threshold = threshold;
+ return def_prog_pass_constructor(
+ &pass->pass, name ? name : "cloning", proc_cloning_wrapper);
+}