beinsn: Remove attribute irn from struct be_operand_t.
[libfirm] / ir / be / beinsn.c
index f82b417..78a9b6b 100644 (file)
@@ -43,6 +43,8 @@ be_insn_t *be_scan_insn(be_chordal_env_t const *const env, ir_node *const irn)
 
        be_insn_t *insn = OALLOCZ(obst, be_insn_t);
 
+       bool has_constraints = false;
+
        insn->irn = irn;
        if (get_irn_mode(irn) == mode_T) {
                ir_node *p;
@@ -60,24 +62,20 @@ be_insn_t *be_scan_insn(be_chordal_env_t const *const env, ir_node *const irn)
                                /* found a def: create a new operand */
                                o.req             = arch_get_irn_register_req(p);
                                o.carrier         = p;
-                               o.irn             = irn;
-                               o.pos             = -(get_Proj_proj(p) + 1);
                                o.partner         = NULL;
                                obstack_grow(obst, &o, sizeof(o));
                                insn->n_ops++;
-                               insn->has_constraints |= arch_register_req_is(o.req, limited) | (o.req->width > 1);
+                               has_constraints |= arch_register_req_is(o.req, limited) | (o.req->width > 1);
                        }
                }
        } else if (arch_irn_consider_in_reg_alloc(env->cls, irn)) {
                /* only one def, create one operand */
                o.req     = arch_get_irn_register_req(irn);
                o.carrier = irn;
-               o.irn     = irn;
-               o.pos     = -1;
                o.partner = NULL;
                obstack_grow(obst, &o, sizeof(o));
                insn->n_ops++;
-               insn->has_constraints |= arch_register_req_is(o.req, limited) | (o.req->width > 1);
+               has_constraints |= arch_register_req_is(o.req, limited) | (o.req->width > 1);
        }
 
        insn->use_start = insn->n_ops;
@@ -90,15 +88,16 @@ be_insn_t *be_scan_insn(be_chordal_env_t const *const env, ir_node *const irn)
                        /* found a register use, create an operand */
                        o.req     = arch_get_irn_register_req_in(irn, i);
                        o.carrier = op;
-                       o.irn     = irn;
-                       o.pos     = i;
                        o.partner = NULL;
                        obstack_grow(obst, &o, sizeof(o));
                        insn->n_ops++;
-                       insn->has_constraints |= arch_register_req_is(o.req, limited);
+                       has_constraints |= arch_register_req_is(o.req, limited);
                }
        }
 
+       if (!has_constraints)
+               return NULL;
+
        insn->ops = (be_operand_t*)obstack_finish(obst);
 
        /* Compute the admissible registers bitsets. */