MLBEDSW-11238: Add FixupControlFlow
This step does 3 things:
- Connect constant inputs to WHILE through a MemoryCopy op to make sure all input tensors to a WHILE has writable memory. This is important later when this operator is converted to a loop with HLCBranch ops in HLCS generator. After each iteration we copy the output back to the input. This wouldn't work if any input is in read-only memory.
- Connect first input to IF through a MemoryCopy op, if it's constant or a graph input, to make sure this input is produced by an operation. This is important so that the HW COND_STATUS register is properly written. This register controls the behavior if OP_BRANCH instruction.
- Reshape inputs and outputs to 3D to ensure the ops will pass the constraints checks.
Signed-off-by: Johan Gunnarsson johan.gunnarsson@arm.com Change-Id: I46b8fd810c0dcb19fd458f36a2fad421fb10cf30