if (!ir_block_create_if(func->curblock, left, merge, other))
return false;
}
+ /* use the unlikely flag */
+ vec_last(func->curblock->instr)->likely = false;
func->curblock = other;
cgen = self->right->expression.codegen;
self->params = NULL;
self->eid = 0;
+
+ self->likely = true;
return self;
}
}
/* neither ontrue nor onfalse exist */
stmt.opcode = INSTR_IFNOT;
+ if (!instr->likely) {
+ /* Honor the likelyhood hint */
+ ir_block *tmp = onfalse;
+ stmt.opcode = INSTR_IF;
+ onfalse = ontrue;
+ ontrue = tmp;
+ }
stidx = vec_size(code_statements);
vec_push(code_statements, stmt);
/* on false we jump, so add ontrue-path */
if (onfalse->generated) {
/* fixup the jump address */
code_statements[stidx].o2.s1 = (onfalse->code_start) - (stidx);
+ stmt.opcode = vec_last(code_statements).opcode;
/* may have been generated in the previous recursive call */
stmt.opcode = INSTR_GOTO;
stmt.o1.s1 = (onfalse->code_start) - vec_size(code_statements);