Use better conditions

This commit is contained in:
Dmitry Stogov 2023-01-23 16:05:06 +03:00
parent 169033c291
commit a5c0514b13
2 changed files with 4 additions and 4 deletions

View File

@ -3216,7 +3216,7 @@ static void ir_emit_alloca(ir_ctx *ctx, ir_ref def, ir_insn *insn)
size = IR_ALIGNED_SIZE(size, 8);
}
| sub sp, sp, #size
if (!(ctx->flags & IR_FUNCTION)) {
if (!(ctx->flags & IR_USE_FRAME_POINTER)) {
data->call_stack_size += size;
}
} else {
@ -3263,7 +3263,7 @@ static void ir_emit_afree(ir_ctx *ctx, ir_ref def, ir_insn *insn)
size = IR_ALIGNED_SIZE(size, 8);
}
| add sp, sp, #size
if (!(ctx->flags & IR_FUNCTION)) {
if (!(ctx->flags & IR_USE_FRAME_POINTER)) {
data->call_stack_size -= size;
}
} else {

View File

@ -5339,7 +5339,7 @@ static void ir_emit_alloca(ir_ctx *ctx, ir_ref def, ir_insn *insn)
size = IR_ALIGNED_SIZE(size, 8);
}
| ASM_REG_IMM_OP sub, IR_ADDR, IR_REG_RSP, size
if (!(ctx->flags & IR_FUNCTION)) {
if (!(ctx->flags & IR_USE_FRAME_POINTER)) {
data->call_stack_size += size;
}
} else {
@ -5395,7 +5395,7 @@ static void ir_emit_afree(ir_ctx *ctx, ir_ref def, ir_insn *insn)
size = IR_ALIGNED_SIZE(size, 8);
}
| ASM_REG_IMM_OP add, IR_ADDR, IR_REG_RSP, size
if (!(ctx->flags & IR_FUNCTION)) {
if (!(ctx->flags & IR_USE_FRAME_POINTER)) {
data->call_stack_size -= size;
}
} else {