bool ir_value_life_merge(ir_value *self, size_t s)
{
size_t i;
+ const size_t vs = vec_size(self->life);
ir_life_entry_t *life = NULL;
ir_life_entry_t *before = NULL;
ir_life_entry_t new_entry;
/* Find the first range >= s */
- for (i = 0; i < vec_size(self->life); ++i)
+ for (i = 0; i < vs; ++i)
{
before = life;
life = &self->life[i];
break;
}
/* nothing found? append */
- if (i == vec_size(self->life)) {
+ if (i == vs) {
ir_life_entry_t e;
if (life && life->end+1 == s)
{
{
ir_instr *instr;
ir_value *value;
- bool tempbool;
size_t i, o, p, mem;
/* bitmasks which operands are read from or written to */
size_t read, write;
* since this function is run multiple times.
*/
/* con_err( "Value only written %s\n", value->name); */
- tempbool = ir_value_life_merge(value, instr->eid);
- *changed = *changed || tempbool;
+ if (ir_value_life_merge(value, instr->eid))
+ *changed = true;
} else {
/* since 'living' won't contain it
* anymore, merge the value, since
* (A) doesn't.
*/
- tempbool = ir_value_life_merge(value, instr->eid);
- *changed = *changed || tempbool;
+ if (ir_value_life_merge(value, instr->eid))
+ *changed = true;
/* Then remove */
vec_remove(self->living, idx, 1);
}
/* Removing a vector removes all members */
for (mem = 0; mem < 3; ++mem) {
if (value->members[mem] && vec_ir_value_find(self->living, value->members[mem], &idx)) {
- tempbool = ir_value_life_merge(value->members[mem], instr->eid);
- *changed = *changed || tempbool;
+ if (ir_value_life_merge(value->members[mem], instr->eid))
+ *changed = true;
vec_remove(self->living, idx, 1);
}
}
break;
}
if (mem == 3 && vec_ir_value_find(self->living, value, &idx)) {
- tempbool = ir_value_life_merge(value, instr->eid);
- *changed = *changed || tempbool;
+ if (ir_value_life_merge(value, instr->eid))
+ *changed = true;
vec_remove(self->living, idx, 1);
}
}
}
/* (A) */
- tempbool = ir_block_living_add_instr(self, instr->eid);
- /*con_err( "living added values\n");*/
- *changed = *changed || tempbool;
+ if (ir_block_living_add_instr(self, instr->eid))
+ *changed = true;
}
/* the "entry" instruction ID */
- tempbool = ir_block_living_add_instr(self, self->entry_id);
- *changed = *changed || tempbool;
+ if (ir_block_living_add_instr(self, self->entry_id))
+ *changed = true;
if (self->run_id == self->owner->run_id)
return true;