mirror of
https://github.com/danog/ir.git
synced 2025-01-22 05:31:32 +01:00
micro-optimization
This commit is contained in:
parent
3535fd2fc4
commit
8660c3cd8b
14
ir_private.h
14
ir_private.h
@ -711,13 +711,16 @@ IR_ALWAYS_INLINE ir_ref ir_operands_count(ir_ctx *ctx, ir_insn *insn)
|
||||
{
|
||||
uint32_t flags = ir_op_flags[insn->op];
|
||||
uint32_t n = IR_OPERANDS_COUNT(flags);
|
||||
if (n == 4) {
|
||||
if (EXPECTED(n < 4)) {
|
||||
/* pass */
|
||||
} else if (n == 4) {
|
||||
/* MERGE or CALL */
|
||||
n = ir_variable_inputs_count(insn);
|
||||
if (n == 0) {
|
||||
n = 2;
|
||||
}
|
||||
} else if (n == 5) {
|
||||
} else {
|
||||
IR_ASSERT(n == 5);
|
||||
/* PHI */
|
||||
n = ir_variable_inputs_count(&ctx->ir_base[insn->op1]) + 1;
|
||||
}
|
||||
@ -728,10 +731,13 @@ IR_ALWAYS_INLINE ir_ref ir_input_edges_count(ir_ctx *ctx, ir_insn *insn)
|
||||
{
|
||||
uint32_t flags = ir_op_flags[insn->op];
|
||||
uint32_t n = IR_INPUT_EDGES_COUNT(flags);
|
||||
if (n == 4) {
|
||||
if (EXPECTED(n < 4)) {
|
||||
/* pass */
|
||||
} else if (n == 4) {
|
||||
/* MERGE or CALL */
|
||||
n = ir_variable_inputs_count(insn);
|
||||
} else if (n == 5) {
|
||||
} else {
|
||||
IR_ASSERT(n == 5);
|
||||
/* PHI */
|
||||
n = ir_variable_inputs_count(&ctx->ir_base[insn->op1]) + 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user