Skip to content

smite-ir: Add InstructionReorderMutator#61

Draft
Chand-ra wants to merge 2 commits into
morehouse:masterfrom
Chand-ra:instr_reorder
Draft

smite-ir: Add InstructionReorderMutator#61
Chand-ra wants to merge 2 commits into
morehouse:masterfrom
Chand-ra:instr_reorder

Conversation

@Chand-ra
Copy link
Copy Markdown

Add an InstructionReorder mutator for Smite IR. Mutates a given program by swapping two '"Act" instructions that have no data dependencies between them. This explores alternative execution orderings while preserving SSA invariants.

Introduce `is_act()` to the set of predicate methods for smite-IR's
`Operation` type. This will be used by `InstructionReorderMutator`
to identify "Act" instructions to swap.
@Chand-ra
Copy link
Copy Markdown
Author

Drafting right now because tests for the mutator are yet to be implemented.

Copy link
Copy Markdown
Owner

@morehouse morehouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks correctly implemented to me.

Unfortunately I don't think it's useful until we implement more Act operations and start generating more interesting programs. Currently we just have SendMessage and RecvAcceptChannel, which we actually don't want to swap (doing so would lead to 5s timeout delays as we wait to receive a message that never comes, which would register as a hang).

I think it would be best to defer further work on this mutator until we have some more interesting things to swap. Then we can figure out how to avoid swapping a Recv* operation to a location before a SendMessage. We will also then be able to collect better data about how often swapping is actually possible with the current implementation, which may lead us to investigate further changes to this mutator (e.g., moving entire dependency trees).

Comment thread smite-ir/src/mutators/instruction_reorder.rs Outdated
Comment thread smite-ir/src/mutators/instruction_reorder.rs Outdated
Comment thread smite-ir/src/mutators/instruction_reorder.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants