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.
Nested SCEVAddRecs are not guaranteed to have strides that go from
larger to smaller. Both cases are valid and can convey interesting
information to DLA. But DLA assumes that the outermost strides are
always larger than the innermost, because this is the only scenario
allowed by well-nested types.
This commit re-orders the strides (and the associated trip counts) so
that they always go from larger to smaller sizes.
The linkOrderLess comparison function is used for sorting the children
edges of a node.
Before this commit, it could not handle the case of comparing an edge
with itself, yielding wrong results (or assertion failure if assertions
were compiled in).
This commit fixes linkOrderLess to handle that case without asserting,
and adds an early return for it, without requiring to inspect the edges
in depth.
DeduplicateUnionFields does not depend on CollapseSingleChild, but can
break if CollapseSingleChild has not run.
However, we don't want to introduce an explicit dependency between the
two steps, because CollapseSingleChild could soon become obsolete on
its own, superseeded by a more powerful and costly step.
This commit changes DeduplicateUnionFields with an additional
pre-processing that runs CollapseSingleChild on each node at step one,
to ensure the step does not fail if CollapseSingleChild child is not
executed.