summaryrefslogtreecommitdiffhomepage
path: root/ir/be/benode.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2015-08-26 13:28:37 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2015-08-29 18:49:41 +0200
commit7670bd0d3e922613f4dd4ce070a79d1975c28943 (patch)
treeec18e8e366c7c1757d5a9917b5ef6c1be0623c27 /ir/be/benode.c
parentfeeff92a4bdcd3e8ce9f32200fdc9af7b0f3c2dc (diff)
be: Add and use be_new_Copy_before_reg().
Diffstat (limited to 'ir/be/benode.c')
-rw-r--r--ir/be/benode.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ir/be/benode.c b/ir/be/benode.c
index 330cc38..ab250e9 100644
--- a/ir/be/benode.c
+++ b/ir/be/benode.c
@@ -19,6 +19,7 @@
#include "beirg.h"
#include "belive.h"
#include "benode.h"
+#include "besched.h"
#include "bitfiddle.h"
#include "fourcc.h"
#include "irbackedge_t.h"
@@ -225,6 +226,15 @@ ir_node *be_get_Copy_op(const ir_node *cpy)
return get_irn_n(cpy, n_be_Copy_op);
}
+ir_node *be_new_Copy_before_reg(ir_node *const val, ir_node *const before, arch_register_t const *const reg)
+{
+ ir_node *const block = get_nodes_block(before);
+ ir_node *const copy = be_new_Copy(block, val);
+ sched_add_before(before, copy);
+ arch_set_irn_register_out(copy, 0, reg);
+ return copy;
+}
+
ir_node *be_new_Keep(ir_node *const block, int const n,
ir_node *const *const in)
{