mirror of
https://github.com/danog/ir.git
synced 2024-11-30 04:39:43 +01:00
Fix spill load
This commit is contained in:
parent
c7e2cca534
commit
ec8489bf6f
@ -2014,8 +2014,13 @@ static int32_t ir_fuse_load(ir_ctx *ctx, ir_ref ref, ir_reg *preg)
|
||||
if (!IR_IS_CONST_REF(load_insn->op2)
|
||||
&& ir_rule(ctx, load_insn->op2) != IR_SKIP_MEM) {
|
||||
/* just fuse the LOAD itself */
|
||||
if (*preg != IR_REG_NONE && *preg != ctx->regs[load_insn->op2][0]) {
|
||||
IR_ASSERT(!((*preg) & IR_REG_SPILL_LOAD));
|
||||
if (*preg != IR_REG_NONE) {
|
||||
ir_reg reg = *preg;
|
||||
if (reg & IR_REG_SPILL_LOAD) {
|
||||
reg &= ~IR_REG_SPILL_LOAD;
|
||||
ir_emit_load(ctx, IR_ADDR, reg, load_insn->op2);
|
||||
*preg = reg;
|
||||
}
|
||||
} else {
|
||||
ir_reg reg = ctx->regs[load_insn->op2][0];
|
||||
IR_ASSERT(reg != IR_REG_NONE);
|
||||
|
Loading…
Reference in New Issue
Block a user