// manipulate output of operation and op_seq
// - replace output of the last operation's output to new operand
- // with old operand's removeDef and new operand's appendDef()
+ // with old operand's unsetDef and new operand's appendDef()
manipulateOutput(op_seq_ind, op_seq_output_ind, new_op_ind);
// new op
last_node.replaceOutputs(op_seq_output_ind, new_op_ind);
// op_seq_obj doesn't have uses/def
- output_obj.removeDef(last_node_ind);
- new_op_obj.insertDef(last_node_ind);
+ assert(output_obj.getDef() == last_node_ind);
+ output_obj.unsetDef();
+ new_op_obj.setDef(last_node_ind);
}
ir::OperationIndex
const auto new_node_ind = operations.push(std::move(new_node));
input_obj.insertUse(new_node_ind);
- new_op_obj.insertDef(new_node_ind);
+ new_op_obj.setDef(new_node_ind);
return new_node_ind;
}
const auto new_node_ind = operations.push(std::move(new_node));
new_op_obj.insertUse(new_node_ind);
- output_obj.insertDef(new_node_ind);
+ output_obj.setDef(new_node_ind);
return new_node_ind;
}
for (auto &ind : first_node.getOutputs() | ir::Remove::DUPLICATED | ir::Remove::UNDEFINED)
{
auto &obj = operands.at(ind);
- obj.removeDef(first_node_ind);
+ assert(obj.getDef() == first_node_ind);
+ obj.unsetDef();
VERBOSE(Fp32ToFp16Converter) << "Operand #" << ind.value() << "'s Def(Node#"
<< first_node_ind.value() << ") is removed" << std::endl;
}