To keep consistency with the rest of PipelineC, return `nullptr` when
calling `rp_container_extract_one` when the content of the specified
target hasn't been produced
Before this commit we couldn't handle gracefully situations where the
model had an array with elements of given size X and the IR had strided
accesses with a stride Y that was larger than X.
This commit gracefully handles that case, but for now it always bail
out.
In the future we could think of handling this better if Y is a multiple
of X.
A logic issue was addressed in `Runner::getDiffInvalidations`.
Premature invalidation of all targets (overestimated targets
found by `getInvalidations`) could lead to an error due to
lack of those targets (do not exist yet). We make sure that
such targets exist before providing them to the pipeline.
A logic issue existed in the Pipe, as it was mistakenly relying on
`IsolatedRoot` instead of the isolated function. That was breaking
things if those functions were to be removed. This issue has been
addressed by correcting the behaviour of the Pipe.
This change makes sure that CollectCFG is always intertwined
with FunctionIsolation, as it needs to run before the latter
executed. To avoid possible rearrangements on the pipeline
in the future, CollectCFG pass is now registered within FI.
`ReadOnlyContainers` is defined to be a `llvm::StringMap`
of a further `llvm::StringMap` of `std::unique_ptr`s of
`ContainerBase`. A logic issue has been addressed by
properly dereferincing the inner map.
A cyclic dependency between shared objects `revngYield` and
`revngFunctionIsolation` could exist if `FunctionIsolation`
were to use `yield`-defined methods. This has been prevented
by splitting pipes off within `Yield`.
A logic issue existed when validating whether a `cl::opt<T>`
was set. This has been addressed by replacing `isDefaultOption`
method with `getNumOccurrences`, as the former one was not
meant to be used for checking if the option was set or not.
Likewise, the default Option itself is written to a `std::string`,
in method `get`; the latter is leveraged by `Invokable`.
Compute the weight of collpased regions the first time it is requested
and cache it, and use the cached value for all successive queries.
This also prevents a bug which occurs when we query the weight two
times for the same collapsed node, whose related collapsed region object
has been in the meantime destroyed by the tiling process.
Ensure that no backedges are left after the restructuring of all the
metaregions.
This additional assertion should help ensuring that no entries in the
`Backedges` set are left after the restructuring process, in turn making
it easier to spot bugs if backedges references are not handled correctly
during the steps of the restructuring.
Before this commit, MakeModelGEPPass was materializing all possible
traversals of the type system to select the best match for translating
some pointer arithmetic on the IR into ModelGEPs.
This proved to be very slow and to do a lot of useless computation on
larger binaries with big type systems.
This commit partially rewrites MakeModelGEPPass to adopt a
branch-and-bound approach to only explore paths on the type system that
have some chance of improving the best match.
There was a log message that we are creating typedef void* for empty
structs, but we have missed that piece of code. This patch adds that
logic.
In the case of unions, we completely ignored empty ones, and also
there was not handling if the type was generated by ordinal (as
in the case of structs). This patch also fixes it.
Before this commit, the dla::Step CompactCompatibleArrays was
occasionally generating artificial nodes that were larger than the inner
data, forcing their size to Stride - AvailableSlack.
This commit fixes the problem keeping track of the actual size that is
consumed in the array element, and forcing the size of the artificial
nodes to that.