Better use placement

This commit is contained in:
Dmitry Stogov 2022-04-15 00:35:02 +03:00
parent 6b0c4435c2
commit 2c2f2dabab
2 changed files with 11 additions and 1 deletions

View File

@ -329,7 +329,7 @@ int ir_compute_live_ranges(ir_ctx *ctx)
} else {
reg = ctx->rules ? ir_uses_fixed_reg(ctx, i, j) : IR_REG_NONE;
if (reg != IR_REG_NONE) {
use_pos = IR_GAP_LIVE_POS_FROM_REF(i);
use_pos = IR_START_LIVE_POS_FROM_REF(i); // TODO: ???
ir_add_fixed_live_range(ctx, reg,
IR_USE_LIVE_POS_FROM_REF(i), IR_DEF_LIVE_POS_FROM_REF(i));
} else {

View File

@ -13,3 +13,13 @@
l_4 = RETURN(l_1, x_3);
}
--EXPECT--
test:
movl %edx, %ecx
movl %edi, %eax
xorl %edx, %edx
divl %esi
movl %edx, %eax
xorl %edx, %edx
divl %ecx
movl %edx, %eax
retq