mirror of
https://github.com/danog/ir.git
synced 2024-11-26 20:34:53 +01:00
Add hint to reuse register in ZEXT/SEXT
This commit is contained in:
parent
d07a2db592
commit
c7e2cca534
3
ir_ra.c
3
ir_ra.c
@ -513,8 +513,7 @@ int ir_compute_live_ranges(ir_ctx *ctx)
|
||||
/* We add two uses to emulate move from op1 to res */
|
||||
ir_add_use(ctx, ctx->vregs[ref], 0, IR_DEF_LIVE_POS_FROM_REF(ref), reg, def_flags, 0);
|
||||
def_pos = IR_LOAD_LIVE_POS_FROM_REF(ref);
|
||||
if (!IR_IS_CONST_REF(insn->op1)) {
|
||||
IR_ASSERT(ctx->vregs[insn->op1]);
|
||||
if (!IR_IS_CONST_REF(insn->op1) && ctx->vregs[insn->op1]) {
|
||||
hint_ref = insn->op1;
|
||||
}
|
||||
} else if (def_flags & IR_DEF_CONFLICTS_WITH_INPUT_REGS) {
|
||||
|
@ -814,8 +814,6 @@ cmp_fp:
|
||||
flags = IR_DEF_REUSES_OP1_REG | IR_USE_MUST_BE_IN_REG | IR_OP1_MUST_BE_IN_REG | IR_OP2_SHOULD_BE_IN_REG;
|
||||
break;
|
||||
case IR_SHIFT_CONST:
|
||||
case IR_COPY_INT:
|
||||
case IR_COPY_FP:
|
||||
case IR_INC:
|
||||
case IR_DEC:
|
||||
case IR_MUL_PWR2:
|
||||
@ -825,6 +823,12 @@ cmp_fp:
|
||||
case IR_OP_FP:
|
||||
flags = IR_DEF_REUSES_OP1_REG | IR_USE_MUST_BE_IN_REG | IR_OP1_MUST_BE_IN_REG;
|
||||
break;
|
||||
case IR_COPY_INT:
|
||||
case IR_COPY_FP:
|
||||
case IR_SEXT:
|
||||
case IR_ZEXT:
|
||||
flags = IR_DEF_REUSES_OP1_REG | IR_USE_MUST_BE_IN_REG | IR_OP1_SHOULD_BE_IN_REG;
|
||||
break;
|
||||
case IR_ABS_INT:
|
||||
flags = IR_DEF_CONFLICTS_WITH_INPUT_REGS | IR_USE_MUST_BE_IN_REG | IR_OP1_MUST_BE_IN_REG;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user