remove old extended basic block related optimizations

This commit is contained in:
Anthony Pesch 2017-08-14 17:48:49 -04:00
parent 482c74211a
commit 5753a5c193
2 changed files with 8 additions and 22 deletions

View File

@ -6,18 +6,12 @@ void cfa_run(struct cfa *cfa, struct ir *ir) {
list_for_each_entry(block, &ir->blocks, struct ir_block, it) {
list_for_each_entry(instr, &block->instrs, struct ir_instr, it) {
/* add edges between blocks for easy traversing */
if (instr->op == OP_BRANCH) {
if (instr->arg[0]->type == VALUE_BLOCK) {
if (instr->op == OP_BRANCH || instr->op == OP_BRANCH_FALSE ||
instr->op == OP_BRANCH_TRUE) {
if (instr->arg[0]->blk) {
ir_add_edge(ir, block, instr->arg[0]->blk);
}
} /* else if (instr->op == OP_BRANCH_COND) {
if (instr->arg[1]->type == VALUE_BLOCK) {
ir_add_edge(ir, block, instr->arg[1]->blk);
}
if (instr->arg[2]->type == VALUE_BLOCK) {
ir_add_edge(ir, block, instr->arg[2]->blk);
}
}*/
}
}
}
}

View File

@ -102,13 +102,9 @@ static void lse_eliminate_loads(struct lse *lse, struct ir *ir,
if (instr->op == OP_FALLBACK || instr->op == OP_CALL) {
lse_clear_available(lse);
} else if (instr->op == OP_BRANCH) {
if (instr->arg[0]->type != VALUE_BLOCK) {
lse_clear_available(lse);
}
lse_clear_available(lse);
} else if (instr->op == OP_BRANCH_TRUE || instr->op == OP_BRANCH_FALSE) {
if (instr->arg[1]->type != VALUE_BLOCK) {
lse_clear_available(lse);
}
lse_clear_available(lse);
} else if (instr->op == OP_LOAD_CONTEXT) {
/* if there is already a value available for this offset, reuse it and
remove this redundant load */;
@ -142,13 +138,9 @@ static void lse_eliminate_stores(struct lse *lse, struct ir *ir,
if (instr->op == OP_FALLBACK || instr->op == OP_CALL) {
lse_clear_available(lse);
} else if (instr->op == OP_BRANCH) {
if (instr->arg[0]->type != VALUE_BLOCK) {
lse_clear_available(lse);
}
lse_clear_available(lse);
} else if (instr->op == OP_BRANCH_TRUE || instr->op == OP_BRANCH_FALSE) {
if (instr->arg[1]->type != VALUE_BLOCK) {
lse_clear_available(lse);
}
lse_clear_available(lse);
} else if (instr->op == OP_LOAD_CONTEXT) {
int offset = instr->arg[0]->i32;
int size = ir_type_size(instr->result->type);