mirror of
https://github.com/danog/ir.git
synced 2025-01-22 05:31:32 +01:00
Introduce IR_PREALLOCATED_STACK flag
This commit is contained in:
parent
1e7059d7e0
commit
da5de8a390
3
ir.h
3
ir.h
@ -473,7 +473,8 @@ typedef struct _ir_use_list {
|
|||||||
|
|
||||||
#define IR_FUNCTION (1<<0)
|
#define IR_FUNCTION (1<<0)
|
||||||
#define IR_USE_FRAME_POINTER (1<<1)
|
#define IR_USE_FRAME_POINTER (1<<1)
|
||||||
#define IR_IRREDUCIBLE_CFG (1<<2)
|
#define IR_PREALLOCATED_STACK (1<<2)
|
||||||
|
#define IR_IRREDUCIBLE_CFG (1<<3)
|
||||||
|
|
||||||
#define IR_OPT_FOLDING (1<<16)
|
#define IR_OPT_FOLDING (1<<16)
|
||||||
#define IR_OPT_CODEGEN (1<<17)
|
#define IR_OPT_CODEGEN (1<<17)
|
||||||
|
@ -3613,7 +3613,7 @@ static int32_t ir_emit_arguments(ir_ctx *ctx, ir_ref def, ir_insn *insn, ir_reg
|
|||||||
bool has_mem_const_args = 0;
|
bool has_mem_const_args = 0;
|
||||||
ir_reg tmp_fp_reg = IR_REG_FP_LAST; /* Temporary register for FP loads and swap */
|
ir_reg tmp_fp_reg = IR_REG_FP_LAST; /* Temporary register for FP loads and swap */
|
||||||
|
|
||||||
if (0) {
|
if (insn->op == IR_CALL && (ctx->flags & IR_PREALLOCATED_STACK)) {
|
||||||
// TODO: support for preallocated stack
|
// TODO: support for preallocated stack
|
||||||
used_stack = 0;
|
used_stack = 0;
|
||||||
} else {
|
} else {
|
||||||
@ -4401,6 +4401,7 @@ static void ir_calc_stack_frame_size(ir_ctx *ctx, ir_backend_data *data)
|
|||||||
data->stack_frame_alignment += 8;
|
data->stack_frame_alignment += 8;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// TODO: Preallocate stack for calls (ctx->flags |= IR_PREALLOCATED_STACK)
|
||||||
while (IR_ALIGNED_SIZE(data->stack_frame_size + sizeof(void*), 16) != data->stack_frame_size + sizeof(void*)) {
|
while (IR_ALIGNED_SIZE(data->stack_frame_size + sizeof(void*), 16) != data->stack_frame_size + sizeof(void*)) {
|
||||||
data->stack_frame_size += 8;
|
data->stack_frame_size += 8;
|
||||||
data->stack_frame_alignment += 8;
|
data->stack_frame_alignment += 8;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user