Before this commit, the creation of layouts in the DLA was very
aggressive, treating almost every instruction as if it could be an
address (hence creating a layout for it).
This commit adds assertions and narrows down the number of cases where
an instruction is actually considered an address.
Specifically, the following kinds of instructions are not considered
addresses anymore:
- Mul
- SDiv
- UDiv
- SRem
- URem
- AShr
- LShr
- Shl
- And
- Xor
- Or
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.
This commit prevents the creation of instance links for offsets that we
don't support yet, during the CreateIntraProceduralTypes DLAStep.
This makes possible to avoid explicitly handling those cases in many
DLASteps, such as ComputeUpperMemberAccess,
ComputeNonInterferingComponents, and DLAMakeLayouts.
The offsets that are not supported yet are:
- all negative offsets
- all strided offsets with non-strictly-positive stride values
- all strided offsets with non-strictly-positive stride values
- all strided offsets with known negative trip-count
Some beneficial side-effects of avoiding the creation of such links are:
- the total number of edges on the graph is reduced, reducing the worst
case depth of most visits
- it's impossible to create types with null or negative size (that we
wouldn't know how to emit in C)