//int match_res, cost;
be_chordal_env_t *env = alloc_env->chordal_env;
void *base = obstack_base(env->obst);
- be_insn_t *insn = chordal_scan_insn(env, irn);
+ be_insn_t *insn = be_scan_insn(env, irn);
ir_node *res = insn->next_insn;
bipartite_t *bp;
bitset_free(live);
}
-
-be_insn_t *chordal_scan_insn(be_chordal_env_t *env, ir_node *irn)
-{
- be_insn_env_t ie;
-
- ie.allocatable_regs = env->allocatable_regs;
- ie.obst = env->obst;
- ie.cls = env->cls;
- return be_scan_insn(&ie, irn);
-}
-
ir_node *pre_process_constraints(be_chordal_env_t *env, be_insn_t **the_insn)
{
be_insn_t *insn = *the_insn;
* the live sets may change.
*/
obstack_free(env->obst, insn);
- *the_insn = insn = chordal_scan_insn(env, insn->irn);
+ *the_insn = insn = be_scan_insn(env, insn->irn);
/*
* Copy the input constraints of the insn to the Perm as output
*/
ir_node *pre_process_constraints(be_chordal_env_t *_env, be_insn_t **the_insn);
-/**
- * Create a be_insn_t for an IR node.
- * @param env The chordal environment.
- * @param irn The node.
- * @return the be_insn for the IR node
- */
-be_insn_t *chordal_scan_insn(be_chordal_env_t *env, ir_node *irn);
-
#endif /* BECHORDAL_COMMON_H_ */
#include "irnode_t.h"
#include "iredges.h"
+#include "bechordal_t.h"
#include "besched.h"
#include "beinsn_t.h"
#include "beirg.h"
#include "beabi.h"
#include "raw_bitset.h"
-/**
- * Create a be_insn_t for an IR node.
- *
- * @param env the insn construction environment
- * @param irn the irn for which the be_insn should be build
- *
- * @return the be_insn for the IR node
- */
-be_insn_t *be_scan_insn(const be_insn_env_t *env, ir_node *irn)
+be_insn_t *be_scan_insn(be_chordal_env_t const *const env, ir_node *const irn)
{
struct obstack *obst = env->obst;
be_operand_t o;
#include "obst.h"
#include "bearch.h"
+#include "bechordal.h"
#include "beirg.h"
typedef struct be_operand_t be_operand_t;
typedef struct be_insn_t be_insn_t;
-typedef struct be_insn_env_t be_insn_env_t;
struct be_operand_t {
ir_node *irn; /**< Firm node of the insn this operand belongs to */
unsigned pre_colored : 1; /**< all defined values already have a register assigned */
};
-struct be_insn_env_t {
- struct obstack *obst;
- const arch_register_class_t *cls;
- bitset_t *allocatable_regs;
-};
-
-#define be_insn_n_defs(insn) ((insn)->use_start)
-#define be_insn_n_uses(insn) ((insn)->n_ops - (insn)->use_start)
-
-be_insn_t *be_scan_insn(const be_insn_env_t *env, ir_node *irn);
+/**
+ * Create a be_insn_t for an IR node.
+ *
+ * @param env the insn construction environment
+ * @param irn the irn for which the be_insn should be build
+ *
+ * @return the be_insn for the IR node
+ */
+be_insn_t *be_scan_insn(be_chordal_env_t const *env, ir_node *irn);
#endif /* FIRM_BE_BEINSN_T_H */
ir_node *irn;
for (irn = sched_first(block); !sched_is_end(irn);) {
- be_insn_t *insn = chordal_scan_insn(env, irn);
+ be_insn_t *insn = be_scan_insn(env, irn);
irn = insn->next_insn;
if (!insn->has_constraints)