Remove code in revng.cli.model_dump and override_by_name that was used
when the model had tags. The code subclassed the default pyYAML loader
to ignore unknown tags to allow reading the model data easily. Since the
model no longer has tags this code is dead and can be removed.
This comparison was used to sort the best results among candidates for
creating ModelGEPs.
However the comparison itself was broken, i.e. you could have 2
different QualifiedTypes T1 and T2 such that T1 < T2 AND T2 < T1.
This caused broken sorting and non-deterministic selection of the best
ModelGEP substitution.
This commit fixes the comparison and as a result the selection of the
best candidate for the emission of ModelGEPs is not completely
deterministic.
Before this commit, the dla::Step depended on InterferingInfo, but this
was superfluous.
This commit drops the dependency and enables the Step to run before
ComputeNonInterferingComponents.
This also avoids the need to run ComputeNonInterferingComponents twice
(one before and one after DeduplicateUnionFields), so it can only run
once.
Before this commit, CollapseSingleChild Step was thinkering around
with InterferingInfo.
Now CollapseSingleChild does not care about InterferingInfo anymore, so
the code handling it can just be dropped.
The step now collapse parents with their single child if they are
indistinguishable, i.e. if the parent has only that single child, at
offset zero, and their size is the same.
Explicitly list the functions whose prototype should be serialized
in the `revng_helpers` header. This is more robust with respect to
future opcodes added in the IR.
When creating the DLA graph, we want to avoid inserting `instanceOf`
edges with huge offsets, so we set a limit to 64K.
This is a workaround to handle cases in which we make wrong decisions
about the base address of a SCEV expression. One of the situations in
which this occurs are expressions such as `&val + BIG_CONST`, for which
we always identify `%val` as the address and `BIG_CONST` as the offset.
When fixing this case, we should still verify that this never happens.
Calls to `OpaqueExtractValue()` are meant to replace `extractvalue`s
found in the LLVM IR. Since the type of an `OpaqueExtractValue` is
identified by both the return type (extracted value) and the first
argument's type (aggregate operand of the `extractvalue` instruction),
we need to consider both when building the associated FunctionPool.
Previously, we were identifying each `OpaqueExtractValue` variant using
only the returned value, which was wrong. In fact, if we have two
`extractvalue` instructions that extract a value of the same type
(e.g. i32) from two different aggregate types (e.g. structA and
structB), we have to define two different `OpaqueExtractValue`: one
that returns an i32 and has a parameter of type structA, and one that
returns an i32 and has a parameter of structB. If we use only the
return type, we are not able to distinguish the two.
Add an explicit dependency between the last decompilation stage and the
headers generation passes, so that we always regenerate decompilation
headers when executing the decompilation step of each test.
Before this commit we were using a suboptimal API that often resulted in
expressions with many zeros for the 0 constant, e.g. 0000000 instead of
just 0.
This commit fixes the problem.
Before this commit, SegregateStackAccessesPass always expected to find
calls stack_size_at_call_site markers injected by
InjectStackSizeProbesAtCallSitesPass.
This is not always true, because aggressive LLVM optimizations can
remove dead code.
As an example, if the user or some analysis earlier in the pipeline
wrongly marks registers as non-arguments, the optimization pipeline will
throw away and eliminate everything that descends from the initial
values of those registers.
This commit enables SegregateStackAccessesPass to cope with calls to
stack_size_at_call_site that were eliminated, and keep going just
considering the calls that are still there.
This pass was never implemented and we don't have plans to do it soon.
This commit just drops it to reduce the noise.
Whenever we decide to implement something similar we'll do it from
scratch.