266 Commits

Author SHA1 Message Date
Alvise de Faveri e90020b94c Don't visit the same union twice during dedup
Optimization to avoid checking the same union node multiple times.
2021-10-11 18:28:03 +02:00
Alvise de Faveri a6d0d52107 Remove leftover call from debugging session
RemoveConflicts should not be needed here, as it runs before in a
separate step and is also ran during deduplication.
2021-10-11 18:25:18 +02:00
Alvise de Faveri e2dd34e08e Avoid comparing a node with itself in union dedup 2021-10-11 18:21:53 +02:00
Alvise de Faveri 43ae7a91cb DLA: Add DeduplicateUnionFields Step
Add a step that recognizes if two subtrees of a union node are
topologically equivalent and merges them. This corresponds to removing
duplicate fields in unions.

This deduplication was prevously done while emitting layouts.

A check is inserted into DLAMakeLayouts to assert that, after
constructing unions, no union has only one child, which could be the
case if we didn't deduplicate union fields in the graph.
2021-10-06 16:37:37 +02:00
Alvise de Faveri 637bf70ff3 DLA: Make CollapseSingleChild a function
Since the reasoning behind single child collapsing can be reused in
other points of the DLA pipeline, move the logic that acts on a single
node in a static function out of the CollapseSingleChild step.
2021-10-05 18:16:21 +02:00
Alvise de Faveri 7e72fc4be1 DLA: Add RemoveConflictingEdges step
Add a DLA step that removes all instance-at-offset-0 edges between nodes
that already have an inheritance edge between them.
2021-10-05 18:16:21 +02:00
Pietro Fezzardi f057441ce8 Fix linking 2021-08-20 11:21:04 +02:00
Alvise de Faveri a0f95e0370 Modify CollapseSingleChild to allow single members
* Inheritance straight lines are now collapsed by CollapseSingleChild
* Don't collapse if parent has more than one parent or if the child has
more than one parent
* Allow the possibility to construct single-member struct: if this
struct is inherited by many other structs, "flattening" the struct is not
the most sensible thing to do, since inheritance information is something
we want to preserve in these cases.
2021-07-27 11:59:48 +02:00
Pietro Fezzardi ae0095e90a DLA: handle Values with unknown Layouts 2021-07-20 15:20:53 +02:00
Alvise de Faveri 4eb50d0bb5 Add Unit Test for DLACollapseSingleChild 2021-06-30 17:50:12 +02:00
Alvise de Faveri c1e4b940d0 Add CollapseSingleChild step to DLA 2021-06-30 17:50:12 +02:00
Alvise de Faveri 47db3fdb11 Promote AccessSizes to full-fledged TS nodes
While doing thie, also drop `printAccessNode()` from DLA DebugPrinter.

The information about which LLVM instruction originated a given access
node is already available in the csv generated by the `dla-accesses-log`
logger.
2021-06-25 18:07:17 +02:00
Pietro Fezzardi d09c7c6ab3 Handle inheritance in with interfering children
Until now, in makeLayout, inheritance edges were ignored when the
children were interfering.
Now the inheritance edges are treated as if they were instance edges at
offset 0.
2021-06-24 17:24:59 +02:00
Pietro Fezzardi 18bff2dba1 DLAMakeLayouts.cpp: drop unused variable 2021-06-24 17:24:59 +02:00
Pietro Fezzardi 6a2e130ec6 Move openFunctionFile to new Utils library 2021-06-21 14:15:30 +02:00
Alvise de Faveri bfdef657f2 Move DLA files to separate folder 2021-06-18 18:24:04 +02:00