ack/mach/proto/mcg/hop.h
David Given 88fb231d6e Better constraint syntax; mcgg now passes register usage information up to mcg;
mcg can track individual hop inputs and outputs (needed for live range
analysis!); the register allocator now puts the basic blocks into the right
order in preparation for live range analysis.
2016-10-05 22:56:25 +02:00

50 lines
841 B
C

#ifndef HOP_H
#define HOP_H
enum insel_type
{
INSEL_STRING,
INSEL_VREG,
INSEL_VALUE,
INSEL_EOI
};
struct insel
{
enum insel_type type;
union
{
const char* string;
struct vreg* vreg;
struct ir* value;
}
u;
};
struct hop
{
int id;
int insn_no;
struct ir* ir;
ARRAYOF(struct insel) insels;
struct vreg* output;
ARRAYOF(struct vreg) ins;
ARRAYOF(struct vreg) outs;
PMAPOF(struct vreg, struct hreg) registers;
};
extern struct hop* new_hop(int insn_no, struct ir* ir);
extern void hop_add_string_insel(struct hop* hop, const char* string);
extern void hop_add_vreg_insel(struct hop* hop, struct vreg* vreg);
extern void hop_add_value_insel(struct hop* hop, struct ir* ir);
extern void hop_add_eoi_insel(struct hop* hop);
extern void hop_print(char k, struct hop* hop);
#endif
/* vim: set sw=4 ts=4 expandtab : */