ack/mach/proto/mcg/ir.h
David Given 9077baa850 Add a bodged in algorithm for converting basic block communication from stacked
variables to SSA. Also add dead block removal and block splicing. IR code is
much better now.
2016-09-22 23:19:29 +02:00

64 lines
1 KiB
C

#ifndef IR_H
#define IR_H
enum
{
IRR_LB = -1,
IRR_AB = -2,
IRR_SP = -3,
IRR_RR = -4,
};
enum
{
IRS_1,
IRS_2,
IRS_4,
IRS_8
};
struct ir
{
int id;
int opcode;
int size;
struct ir* left;
struct ir* right;
union
{
arith ivalue;
int rvalue;
const char* lvalue;
struct basicblock* bvalue;
struct
{
ARRAY(struct ir, imports);
} phivalue;
} u;
bool is_sequence : 1;
};
extern const char* ir_names[];
extern struct ir* new_ir0(int opcode, int size);
extern struct ir* new_ir1(int opcode, int size,
struct ir* c1);
extern struct ir* new_ir2(int opcode, int size,
struct ir* c1, struct ir* c2);
extern struct ir* new_labelir(const char* label);
extern struct ir* new_wordir(arith value);
extern struct ir* new_constir(int size, arith value);
extern struct ir* new_bbir(struct basicblock* bb);
extern struct ir* new_anyir(int size);
extern struct ir* new_localir(int offset);
extern struct ir* ir_find(struct ir* ir, int opcode);
extern void ir_print(char k, const struct ir* ir);
#include "ircodes.h"
#endif