smite-ir: Add InstructionDeleteMutator#60
Conversation
Introduce NOP to Smite's IR operations. This will be used by `InstructionDeleteMutator` to delete random instructions from a program by replacing them with NOP.
Are there any advantages to having two ways to delete an operation? If not, I would prefer to use only |
If we only keep the If we want to only keep one mutation scheme, I say we should go with index renumbering.
Yes, we handle that in this part of the code. We first check if any operation uses our deleted instruction as input. If yes, we search for a previously defined instruction with the same type as the deleted one (returns false if no such instruction exists) and then replace instances of our deleted instruction with the found replacement. |
|
Perhaps there's a middle path -- we could have our mutators insert |
Sounds good to me. |
Add an
InstructionDeletemutator for Smite IR. Mutates a given program by deleting a randomly selected instruction.Deletion of an instruction can happen in one of two ways:
(i) Replacing it with a
Operation::Nop(50% chance).(ii) Removing it from the instructions list and reindexing the subsequent instructions (50% chance).