Commit Graph

8 Commits

Author SHA1 Message Date
Pietro Fezzardi dc84daf7e8 DLATypeSystem: add assertion on mergeNodes
The mergeNodes API is not guaranteed to work properly if the 2 merged
nodes are the same.
This commit adds an assertion to rule this situation out.
2021-02-03 12:00:04 +01:00
Pietro Fezzardi 2485cd2c8b DLAHelpers: relax assumptions on ExtractValueInst
Before this commit, the DLA code made very strong assumptions about
Functions that returned struct types.
In particular, calls to such Functions were expected to have at most a
number of uses equal to the number of fields of the returned struct.
Moreover, such uses were only expected to be ExtractValueInst.

Now, we still assume that such uses are ExtractValueInst, but we don't
make any strong assumption on their number anymore.

This makes the DLA code less reliant on specific form of LLVM IR, so we
can also drop -gvn-hoist from the decompilation test pipeline.
2021-02-02 11:23:53 +01:00
Pietro Fezzardi 730854aa1c [DLA] Add CreateNonInterferingComponents DLAStep 2021-02-02 11:23:53 +01:00
Pietro Fezzardi 6ae374b5f0 [DLA] Add InterferingInfo to LayoutTypeSystemNode
This is a flag used to mark a given `LayoutTypeSystemNode`.
It represents the fact that the children nodes are either all
interfering with each other, non-interfering with each other, or
unknown.

This information will be filled-in by the
`ComputeNonInterferingComponents` step, and will be used from the
`MakeLayouts` step to decide if the children of the node will be emitted
as fields of a union (interfering) or fields of a struct
(non-interfering).
2021-02-02 11:23:53 +01:00
Pietro Fezzardi c40b3c5386 [DLA] Add LayoutTypeSystem::createArtificialLayout
This method allows to create artificial layouts that are not directly
associated to `llvm::Value`s.
Because of this missing association with `Value`s, the artificial
layouts are not retrievable by using the public `getOrCreateLayoutType`
and `getLayoutType` methods of `LayoutTypeSystem`, but they will be
accessible only by walking the graph.

The capability to add layouts that are not associated to `llvm::Value`s
is necessary for the future implementation of the DLA Step:
`ComputeNonInterferingComponents`.
The step will add artificial layouts to represent non-intefering
components.
2021-02-02 11:23:53 +01:00
Pietro Fezzardi 46a504b9ea [DLA] Drop useless method from LayoutTypeSystem 2021-02-02 11:23:53 +01:00
Pietro Fezzardi cdca33a99f [DLA] Guard costly verify calls with VerifyLog 2021-02-02 11:23:53 +01:00
Pietro Fezzardi fc48930e5e [DLA] Add data structures for dla::TypeSystem 2021-02-02 11:23:53 +01:00