17 Commits

Author SHA1 Message Date
Alessandro Di Federico c883bed765 Drop Logger's StaticEnabled feature 2025-10-31 17:25:03 +01:00
Giacomo Vercesi 0ac78dddba Fix codespell errors
Fix erros detected by the new version of `codespell`.
2025-04-24 13:22:14 +02:00
Alessandro Di Federico 8706fd8459 Initialize pointers to nullptr 2024-09-27 10:35:10 +02:00
Pietro Fezzardi 4fc37fe7eb DLA: improve ArrangeAccessesHierarchically logs 2024-06-18 11:19:50 +02:00
Pietro Fezzardi 64d41a9b1d DLA: fix ArrangeAccessesHierarchically iteration
Before this commit the code was wrong in 2 ways:
- if failed to iterate on children, because it iterated a range that was
  effectively [begin, begin) instead of [begin, end)
- the update of the ARootNext iterator in the loop was broken, but it
  was impossible to realize that since the loop was never taken

This commit fixes both these intertwined problems.
2024-06-18 11:19:50 +02:00
Alessandro Di Federico 0c212b66d9 Relicense to MIT 2024-02-29 17:03:36 +01:00
Pietro Fezzardi bf69d271cf DLA: replace some auto with uint64_t
Explicit is better than implicit.
2023-12-05 16:59:08 +01:00
Pietro Fezzardi c3b69be618 DLA: ArrangeAccessesHierarchically keeps NonScalar 2023-08-21 16:18:31 +02:00
Ivan Krysak 888e5371eb Formatting: change PenaltyReturnTypeOnItsOwnLine
The new value is 21.
2023-07-05 06:06:07 +00:00
Giacomo Vercesi a4ad571e61 rcc: Fix typos
Fix the typos detected by `codespell`
2023-05-11 10:04:32 +02:00
Pietro Fezzardi 3fe74cdb0d DLA: single-step ArrangeAccessesHierarchically
The dla::Step ArrangeAccessesHierarchically looks throught the DLA graph
and for each node with many outgoing instance edges tries to see if some
of them are hierachically contained within each other.

In order to do this, before this commit, we were building an auxiliary
graph representing this hierarchy, and in order to build it we had to
perform a number of comparisons between edges that was quadratic with
the number of edges.
Moreover, once all the comparisons were done, we had a deep graph
representing inclusion between edges, but we only cared about the
top-level of this graph, i.e. only the edges that contained other edges
hierarchically, but were not contained in other edges (we'll call them
the root edges).
So we were doing a quadratic number of comparisons but possibly many of
them were useless.
Finally, all the edges that were included in root edges, were pushed
down, but only for a single layer, because they needed to be re-compared
later with the children of the root edges they were being pushed
through. This latter part was responsible for a lot of wasted
computation that just needed to be done over and over at all the layers.
Overall this algorithm was doing a lot of wasted computation.

This commit replaces this logic with a new algorithm.
Now we keep track only of the root edges, and we compare only root edges
with other root edges.
Initially all edges are root edges.
Then we start comparing them.
If a root edge A is included in another one B, then A is not a root edge
anymore, and all the edges that were previously found to be included in
A are not included in B.
This algorithm still does a worst case of quadratic number of
comparisons, but drastically reduces the amount of useless computation
that is redone later. In particular:
- in cases where there are a lot of root edges (meaning that only a few,
  or no edge can be included in others) we do a number of comparison
  close to quadratic, but we're only pushing non-root edges down, so
  we'll never have to redo comparisons in deeper layers
- in cases where there is only a small number of root edges, we're doing
  a number of comparisons close to linear, and we never compare non-root
  edges with each other, so we're saving a lot of computation that would
  be wasted (because it would need to be redone in deeper layers).
2023-01-20 00:45:09 +01:00
Pietro Fezzardi 682cf2067c DLA: ArrangeAccessHierarchically uses RPOT
Before this commit we were manually building a topological ordering,
that resulted in worse overall performance in some scenarios.

This commit changes the dla::Step to temporarily introduce a fake root
node, and computes a RPOT from there, which overall yields better
results.
2023-01-19 14:51:35 +01:00
Pietro Fezzardi 8d7568710a DLA: add PushDownPointers dla::Step 2022-09-30 18:34:10 +02:00
Pietro Fezzardi 8e75677307 ArrangeAccessesHierarchically: push down pointers
This commit enables ArrangeAccessesHierachically to push down pointer
edges when rearranging accesses hierarchically.

In particular, if an edge N is being pushed down another edge M, and M
is at offset 0, and N reaches a pointer edge PE that points to a
grandparent G of M at offset 0, then we want to push down the pointer
edge PE so that it points to the target of M, unless there is another
edge M' different from M, such that M' has the same properties of M but
target(M) != target(M').
2022-09-29 18:38:11 +02:00
Pietro Fezzardi b4e57e2799 DLA: ArrangeAccessesHierarchically uses mergeNodes
Before this commit, ArrangeAccesseHierachically was removing nodes from
the graph, instead of merging them.
This degraded the information collected on the graph useful for debug.
This commit drops the use of removeNode method, and switches to using
mergeNodes, that preserves the useful debug information when merging.
2022-09-29 18:38:11 +02:00
Pietro Fezzardi c5236310a9 Use uint64_t only in dla::OffsetExpression
Before this commit we were using int64_t for Offset, Strides, and
TripCounts.

Originally, this choice was intended because for some time we envisioned
actually having a use for negative values, but in the end we decided
there's no use for those.

This commit switches all to unsigned integers, allowing to remove some
static_cast across the codebase, and overall easing typicall computation
we have to perform on those fields.
2022-09-29 18:38:11 +02:00
Pietro Fezzardi f0a1903201 DLA: add ArrangeAccessesHierarchically dla::Step 2022-09-15 11:47:11 +02:00