Update IR

IR commit: 1a41bddcf0a41b9a3866d00b57591b3684c88443
This commit is contained in:
Dmitry Stogov 2024-12-03 13:01:31 +03:00
parent 50264b03a0
commit f04a9f466f
No known key found for this signature in database
3 changed files with 9 additions and 7 deletions

View file

@ -1139,6 +1139,12 @@ ir_ref ir_bind(ir_ctx *ctx, ir_ref var, ir_ref def)
return def;
}
ir_ref ir_binding_find(const ir_ctx *ctx, ir_ref ref)
{
ir_ref var = ir_hashtab_find(ctx->binding, ref);
return (var != (ir_ref)IR_INVALID_VAL) ? var : 0;
}
/* Batch construction of def->use edges */
#if 0
void ir_build_def_use_lists(ir_ctx *ctx)

View file

@ -743,7 +743,10 @@ ir_ref ir_fold3(ir_ctx *ctx, uint32_t opt, ir_ref op1, ir_ref op2, ir_ref op3);
ir_ref ir_param(ir_ctx *ctx, ir_type type, ir_ref region, const char *name, int pos);
ir_ref ir_var(ir_ctx *ctx, ir_type type, ir_ref region, const char *name);
/* IR Binding */
ir_ref ir_bind(ir_ctx *ctx, ir_ref var, ir_ref def);
ir_ref ir_binding_find(const ir_ctx *ctx, ir_ref ref);
/* Def -> Use lists */
void ir_build_def_use_lists(ir_ctx *ctx);

View file

@ -1013,13 +1013,6 @@ IR_ALWAYS_INLINE uint32_t ir_insn_len(const ir_insn *insn)
#define IR_RESERVED_FLAG_1 (1U<<31)
/*** IR Binding ***/
IR_ALWAYS_INLINE ir_ref ir_binding_find(const ir_ctx *ctx, ir_ref ref)
{
ir_ref var = ir_hashtab_find(ctx->binding, ref);
return (var != (ir_ref)IR_INVALID_VAL) ? var : 0;
}
/*** IR Use Lists ***/
struct _ir_use_list {
ir_ref refs; /* index in ir_ctx->use_edges[] array */