A logic bug caused the wrong detection of nodes with many fields.
As a result, the field deduplication was only executed on a subset of
the real candidates.
This caused the following two problems.
- Degradation of the quality of the results, i.e. unions that could be
deduplicated were not deduplicated.
- Failing assertions in rare cases.
The algorithm assumes that if it's looking at the children
(C1, ..., Cn) of node A to be deduplicated, then all (C1, ..., Cn)
have beed already visited, hence they don't have children that should
be duplicated because they would have been deduplicated already, when
looking at (C1, ..., Cn). The bug possibly caused to miss the
deduplication of children of Ci (for some i) causing assertions to
fail when looking at A to deduplicate (C1, ..., Cn).
This commit adds placeholder pointer nodes to the DLA graph during
initialization, to point to nodes that represent model types whose size
should not altered during the Middleend.
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.
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.
These two parts of the code needed to be separated into libraries
because they were used both by the old C backend and by
IRCanonicalization.
Now that the old C backend is dead, they have been incorporated into
IRCanonicalization.
Further changes are necessary to strip away the last leftovers of the
old C backend from MarkAnalysis.
Change company name to "rev.ng Labs Srl" in all license headers
to reflect changed company name and legal status
Add missing license headers to files that didn't have one
Before this commit, each dla::Step handled the printing of its own .dot
files for debug.
This commit moves the logic for dumping the .dot files into the main
loop of dla::StepManager, guarding it with a single Logger.
Before this commit, the dla::Step RemoveInvalidStrideEdges was not
taking into account that dropping edges could change the size of the
node where the edges originated from.
This commit fixes the problem, a) recomputing the size automatically
when needed, and b) adding proper dependencies in the dla middleend
pipeline, so that these changes are properly propagated updwards and
don't break any pre-conditions of following dla::Steps.
This step removes redundant instance-at-offset-0, collapsing the child
into the parent, whenever this operation does not induce instance-loops
on the graph.
This is intended to reduce the number of shallow wrapper structs and
unions.
Before this commit there was a single pass removing equality SCC and
inheritance SCC.
This commit splits the removal of each kind of SCC in a separate
DLAStep, and adds handling of instance-at-offset-0 SCCs that were not
considered before.
Before this commit, DLAMakeModelTypes was generating broken types in
several corner cases involving unions with children at offset different
than zero, and strided accesses.
This commit fixes these issues and reworks the pass to also consider
strides and model::Qualifiers in the correct order.