represents rep prefix with the while statement in x86 #998
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The old representation inherited from BAP 0.x was representing
repz<code>
aswhere
next
andstart
were concrete addresses of the current andthe next instructions. It goes without saying that such code
has a very bloated graph representation.
A more tight representation, which could also be nicecly reified into
a graph could be produced using BIL's
while
statement, which isreflected to the Core Theory
repeat
term. The same instruction willnow have the following representation:
which is reified into the following IR:
Which is much smaller than the original IR.
Another nice property of the new representation is that it doesn't
contain any absolute jumps therefore is rellocatable. Additionally, it
is no longer classified as jump or barrier and is a pure data effect.
Caveats
We still have a small suboptimality in the form of a bogus
head: goto tail
block, which comes from the how we represent graphs in our denotational semantics. This block could be removed with a simple optimization pass after an instruction is lifted, but I don't think it is worthwhile to do it right now, given how scarce such kind of instructions could be.