/* See which operands are read and write operands */
ir_op_read_write(instr->opcode, &read, &write);
- if (instr->opcode == INSTR_MUL_VF)
- {
- /* the float source will get an additional lifetime */
- tempbool = ir_value_life_merge(instr->_ops[2], instr->eid+1);
- *changed = *changed || tempbool;
- }
- else if (instr->opcode == INSTR_MUL_FV)
- {
- /* the float source will get an additional lifetime */
- tempbool = ir_value_life_merge(instr->_ops[1], instr->eid+1);
- *changed = *changed || tempbool;
- }
-
/* Go through the 3 main operands
* writes first, then reads
*/
}
}
+ if (instr->opcode == INSTR_MUL_VF)
+ {
+ value = instr->_ops[2];
+ /* the float source will get an additional lifetime */
+ if (ir_value_life_merge(value, instr->eid+1))
+ *changed = true;
+ if (value->memberof && ir_value_life_merge(value->memberof, instr->eid+1))
+ *changed = true;
+ }
+ else if (instr->opcode == INSTR_MUL_FV)
+ {
+ value = instr->_ops[1];
+ /* the float source will get an additional lifetime */
+ if (ir_value_life_merge(value, instr->eid+1))
+ *changed = true;
+ if (value->memberof && ir_value_life_merge(value->memberof, instr->eid+1))
+ *changed = true;
+ }
+
for (o = 0; o < 3; ++o)
{
if (!instr->_ops[o]) /* no such operand */
oprintf("endmodule %s\n", b->name);
}
+static const char *storenames[] = {
+ "[global]", "[local]", "[param]", "[value]", "[return]"
+};
+
void ir_function_dump(ir_function *f, char *ind,
int (*oprintf)(const char*, ...))
{
attr = "unique ";
else if (v->locked)
attr = "locked ";
- oprintf("%s\t%s: %s %s%s@%i ", ind, v->name, type_name[v->vtype],
+ oprintf("%s\t%s: %s %s %s%s@%i ", ind, v->name, type_name[v->vtype],
+ storenames[v->store],
attr, (v->callparam ? "callparam " : ""),
(int)v->code.local);
+ if (!v->life)
+ oprintf("[null]");
for (l = 0; l < vec_size(v->life); ++l) {
oprintf("[%i,%i] ", v->life[l].start, v->life[l].end);
}
ir_value *vm = v->members[m];
if (!vm)
continue;
- if (vm->unique_life && vm->locked)
- attr = "unique,locked ";
- else if (vm->unique_life)
- attr = "unique ";
- else if (vm->locked)
- attr = "locked ";
- oprintf("%s\t%s: %s@%i ", ind, vm->name, attr, (int)vm->code.local);
+ oprintf("%s\t%s: @%i ", ind, vm->name, (int)vm->code.local);
for (l = 0; l < vec_size(vm->life); ++l) {
oprintf("[%i,%i] ", vm->life[l].start, vm->life[l].end);
}
attr = "unique ";
else if (v->locked)
attr = "locked ";
- oprintf("%s\t%s: %s %s%s@%i ", ind, v->name, type_name[v->vtype],
+ oprintf("%s\t%s: %s %s %s%s@%i ", ind, v->name, type_name[v->vtype],
+ storenames[v->store],
attr, (v->callparam ? "callparam " : ""),
(int)v->code.local);
+ if (!v->life)
+ oprintf("[null]");
for (l = 0; l < vec_size(v->life); ++l) {
oprintf("[%i,%i] ", v->life[l].start, v->life[l].end);
}