mirror of
https://github.com/danog/ir.git
synced 2024-11-26 20:34:53 +01:00
Result of PARAM may be stored into a spill slot without register
This commit is contained in:
parent
a5b676b590
commit
4f294109e8
10
ir_ra.c
10
ir_ra.c
@ -1506,7 +1506,15 @@ static ir_reg ir_allocate_blocked_reg(ir_ctx *ctx, int current, uint32_t len, ir
|
||||
/* all other intervals are used before current, so it is best to spill current itself */
|
||||
/* assign spill slot to current */
|
||||
/* split current before its first use position that requires a register */
|
||||
ir_live_pos split_pos = ir_find_optimal_split_position(ctx, current, ival, ival->range.start, next_use_pos - 1);
|
||||
ir_live_pos split_pos;
|
||||
|
||||
if (next_use_pos == ival->range.start) {
|
||||
IR_ASSERT(use_pos && use_pos->op_num == 0);
|
||||
/* split right after definition */
|
||||
split_pos = next_use_pos + 1;
|
||||
} else {
|
||||
split_pos = ir_find_optimal_split_position(ctx, current, ival, ival->range.start, next_use_pos - 1);
|
||||
}
|
||||
|
||||
if (split_pos > ival->range.start) {
|
||||
IR_LOG_LSRA(" ---- Conflict with others", current, ival, " (all others are used before)");
|
||||
|
@ -959,6 +959,8 @@ uint8_t ir_get_use_flags(ir_ctx *ctx, ir_ref ref, int op_num)
|
||||
case IR_DIV_INT:
|
||||
case IR_MOD_INT:
|
||||
return (op_num == 2) ? IR_USE_SHOULD_BE_IN_REG : IR_USE_MUST_BE_IN_REG;
|
||||
case IR_PARAM:
|
||||
return IR_USE_SHOULD_BE_IN_REG;
|
||||
}
|
||||
|
||||
return IR_USE_MUST_BE_IN_REG;
|
||||
|
Loading…
Reference in New Issue
Block a user