ir_init: Expose min limit for constants and instructions

Signed-off-by: Anatol Belski <ab@php.net>
This commit is contained in:
Anatol Belski 2023-03-27 00:54:08 +02:00
parent f55b9b094b
commit b701684704
2 changed files with 5 additions and 2 deletions

4
ir.c
View File

@ -286,8 +286,8 @@ void ir_init(ir_ctx *ctx, ir_ref consts_limit, ir_ref insns_limit)
{
ir_insn *buf;
IR_ASSERT(consts_limit >= -(IR_TRUE - 1));
IR_ASSERT(insns_limit >= IR_UNUSED + 1);
IR_ASSERT(consts_limit >= IR_CONSTS_LIMIT_MIN);
IR_ASSERT(insns_limit >= IR_INSNS_LIMIT_MIN);
ctx->insns_count = IR_UNUSED + 1;
ctx->insns_limit = insns_limit;

3
ir.h
View File

@ -347,6 +347,9 @@ typedef int32_t ir_ref;
#define IR_TRUE (-3)
#define IR_LAST_FOLDABLE_OP IR_COPY
#define IR_CONSTS_LIMIT_MIN (-(IR_TRUE - 1))
#define IR_INSNS_LIMIT_MIN (IR_UNUSED + 1)
/* IR Constant Value */
#ifndef IR_64
# define ADDR_MEMBER uintptr_t addr;