summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beasm.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2018-05-28 08:03:20 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2018-05-28 22:25:01 +0200
commitca580002f5662585ea2b6791dc9ac34425ac61e9 (patch)
tree2815b88071e0ae6be257457b7c7d15a79330c0c5 /ir/be/beasm.c
parenta8c35bedf39682678bd058783f3ef37997d7d848 (diff)
be: For consistency make memory the first input of be_Asm.
Diffstat (limited to 'ir/be/beasm.c')
-rw-r--r--ir/be/beasm.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/ir/be/beasm.c b/ir/be/beasm.c
index 75ba7ea..6b445c3 100644
--- a/ir/be/beasm.c
+++ b/ir/be/beasm.c
@@ -158,8 +158,11 @@ be_asm_info_t be_asm_prepare_info(ir_node const *const node)
{
unsigned const n_outs = be_count_asm_outputs(node);
arch_register_req_t const **const out_reqs = NEW_ARR_F(arch_register_req_t const*, n_outs);
- ir_node **const ins = NEW_ARR_F(ir_node*, 0);
- arch_register_req_t const **const in_reqs = NEW_ARR_F(arch_register_req_t const*, 0);
+
+ ir_node **const ins = NEW_ARR_F(ir_node*, n_be_Asm_first_in);
+ arch_register_req_t const **const in_reqs = NEW_ARR_F(arch_register_req_t const*, n_be_Asm_first_in);
+ ins[n_be_Asm_mem] = be_transform_node(get_ASM_mem(node));
+ in_reqs[n_be_Asm_mem] = arch_memory_req;
return (be_asm_info_t){
.ins = ins,
@@ -245,7 +248,7 @@ ir_node *be_make_asm(ir_node const *const node, be_asm_info_t const *const info,
}
/* Restrict inputs by clobbers. */
- for (size_t i = 0, n = ARR_LEN(in_reqs); i != n; ++i) {
+ for (size_t i = n_be_Asm_first_in, n = ARR_LEN(in_reqs); i != n; ++i) {
arch_register_req_t const *const req = in_reqs[i];
arch_register_class_t const *const cls = req->cls;
assert(cls->index < ARRAY_SIZE(clobber_bits));
@@ -290,16 +293,14 @@ ir_node *be_make_asm(ir_node const *const node, be_asm_info_t const *const info,
}
} else {
bitset_t *const used_outs = bitset_alloca(orig_n_outs);
- for (unsigned i = 0; i < orig_n_ins; ++i) {
+ for (unsigned i = n_be_Asm_first_in; i < orig_n_ins; ++i) {
arch_register_req_t const *const inreq = in_reqs[i];
if (!match_requirement(out_reqs, orig_n_outs, used_outs, inreq))
add_pressure[inreq->cls->index]++;
}
}
- /* Add memory input and output. */
- ARR_APP1(ir_node*, in, be_transform_node(get_ASM_mem(node)));
- ARR_APP1(arch_register_req_t const*, in_reqs, arch_memory_req);
+ /* Add memory output. */
ARR_APP1(arch_register_req_t const*, out_reqs, arch_memory_req);
dbg_info *const dbgi = get_irn_dbg_info(node);