<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/slang/slang-ir-liveness.h, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2024-10-29T06:49:26+00:00</updated>
<entry>
<title>format</title>
<updated>2024-10-29T06:49:26+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2024-10-29T06:49:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21'/>
<id>urn:sha1:f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21</id>
<content type='text'>
* format

* Minor test fixes

* enable checking cpp format in ci</content>
</entry>
<entry>
<title>Create and cache flattened inheritance lists (#2740)</title>
<updated>2023-07-13T00:17:43+00:00</updated>
<author>
<name>Theresa Foley</name>
<email>10618364+tangent-vector@users.noreply.github.com</email>
</author>
<published>2023-07-13T00:17:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=98ba936ed91328338ba95525dd658d5cde6582de'/>
<id>urn:sha1:98ba936ed91328338ba95525dd658d5cde6582de</id>
<content type='text'>
* Create and cache flattened inheritance lists

The basic change here is to have a cached lookup that can map a `Type`,
or a `DeclRef` that might refer to a type or `extension`, to a list of
the *facets* that comprise it.

The notion of a *facet* here is similar to what the C++ standard calls
"sub-objects".
A declared type like a `struct` has:

* a facet for its own direct members
* one facet for each of its (transitive) base `struct` types
* one facet for each `interface` it conforms to
* one facet for each `extension` that applies to that type

The set of facets for a type is de-duplicated (so that "diamond"
inheritance patterns don't cause issues) and deterministically ordered,
using a variation of the C3 linearization algorithm.

The creation of a linearized list of facets should help the compiler
implementation in two key places:

* Testing if a type implements an interface (or inherits from a base
  type) should now only take time linear in the number of (transitive)
  bases of that type. We can simply scan the linearized facet list to
  see if it contains a facet corresponding to the given base.

* Looking up the members of a type (or a value of a given type) should
  be greatly simplified, since all of the members can be found in a
  single linear scan of the facet list. In addition, those facets will
  be ordered so that facets for "more derived" types will precede those
  for "less derived" types, so that shadowing in the case of overrides
  should be easier to implement.

This change only implements the first of these two improvements, since
there is already a *lot* of churn involved.

Notes and caveats:

* The handling of conjunction types (e.g., `IFoo &amp; IBar`) complicates
  the implementation, both because the simple approach to subtype
  testing alluded to above is no longer complete, and also because
  we need to be more careful about what forms of subtype witnesses
  we construct, so that we can maintain the currently-required invariant
  that two witnesses are only equal if they have matching structure.

* We don't implement the full/"proper" C3 algorithm here because it has
  some failure cases that we'd still like to support. In particular if
  we have both `IX : IA, IB` and `IY : IB, IA`, the C3 algorithm says it
  is illegal to have `IZ : IX, IY` because the two bases it inherits
  from disagree on the relative ordering of `IA` and `IB` in their
  own linearizations. Handling such cases may make our implementation
  less efficient, and it will also require testing of those corner
  caes.

* When it comes time to revamp the implementation of lookup, we will
  need to deal with the fact that a single linear list (seemingly)
  cannot give us sufficient information to decide which of two members
  of the same name should shadow the other, or if there is an ambiguity.
  Or rather, it *can* give us that information if we are willing to
  accept some very user-unfriendly behavior and simply say that
  declarations earlier in the linearization always shadow later
  declarations, even if the facets involved are not related by an
  inheritance relationship of any kind.

* In order to remove one kind of vicious circularity from the approach,
  the linearization that we are computing for `extension` declarations
  will not be sufficient for lookups in the body of such an `extension`.
  A future change may need to have support for creating and caching
  two distinct linearizations for each `extension`: one that is to be
  used when that `extension` is pulled into the linearization for a
  type that it applies to, and another for when lookup will be performed
  in the context of the `extension` itself.

* This change does *not* include the simple expedient of adding a direct
  cache for subtype tests to the `SharedSemanticsContext`, although
  adding such a cache would be a simple matter.

* This change introduces more deduplication for subtype witnesses,
  which should enable more deduplication for other `Val`s (including
  `Type`s), but it does not introduce any assumptions that equal
  `Val`s or `Type`s must have identical pointer representations.

* Eventually we may find that, similar to the situation with `Type`s,
  we will want to have a split between surface-level and canonicalized
  versions of other `Val`s, including subtype witnesses.

* Fix clang error.

* remove debugging code.

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Remove LivenessLocation (#2248)</title>
<updated>2022-05-26T18:12:46+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2022-05-26T18:12:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=abb89b3e460e11e8f9a134199c2d559190bfc47e'/>
<id>urn:sha1:abb89b3e460e11e8f9a134199c2d559190bfc47e</id>
<content type='text'>
* #include an absolute path didn't work - because paths were taken to always be relative.

* Remove the need for LivenessLocation.

* Use LivenessMode.

* Fix some comments.

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Liveness tracking with phis (#2233)</title>
<updated>2022-05-17T17:12:59+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2022-05-17T17:12:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=90c123a177b6282e797ee4c90b17bee867876c1a'/>
<id>urn:sha1:90c123a177b6282e797ee4c90b17bee867876c1a</id>
<content type='text'>
* #include an absolute path didn't work - because paths were taken to always be relative.

* Refactor Liveness pass, such that locations can be found independently of setting up ranges.

* Refactor around different stages of liveness span analysis.

* WIP Take into account PHI temporaries in liveness tracking.

* WIP First pass of PHI liveness refactor.

* Add BlockIndex.

* WIP Refactor phi liveness around inst runs.

* More improvements around liveness tracking.

* Bug fixes.
Special handling to not add multiple ends, at starts of blocks and after accesses.

* Fix test output.

* Use IRInsertLoc to track insertion point.

* Liveness markers don't have side effects.

* Fix typo in liveness test.

* Small improvements around setting SuccessorResult.

* Fix memory issue around reallocation and RAIIStackArray.
Update test output.

* Update test output for liveness.slang.

* Fix typo in SuccessorResult blockIndex.

* Small tidy up.

* Handle the root start block, correctly scoping the run.

* Split BlockInfo into 'Root' and 'Function'.
Store successors as BlockIndices.

* Tidy up around liveness tracking.

* Add head/tail support to ArrayViews.
Use Count where appropriate.
Use head/tail in liveness impl.</content>
</entry>
<entry>
<title>Preliminary Liveness tracking (#2218)</title>
<updated>2022-05-05T13:09:25+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2022-05-05T13:09:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e3e0132743ada1569cefe18bfbf54178330204c4'/>
<id>urn:sha1:e3e0132743ada1569cefe18bfbf54178330204c4</id>
<content type='text'>
* #include an absolute path didn't work - because paths were taken to always be relative.

* WIP tracking liveness.

* Skeleton around adding liveness instructions.

* Calling into liveness tracking logic.
Adds live start to var insts.

* Liveness macros have initial output.

* Looking at different initialization scenarios.

* Some discussion around liveness.

* WIP for working out liveness end.

* WIP Updated liveness using use lists.

* Is now adding liveness information

* Some small fixes.

* WIP around liveness.

* Seems to output liveness correctly for current scenario.

* Tidy up liveness code.

* Update comment arounds liveness to current status.

* Small fixes to liveness test.

* Add support for call in liveness analysis.

* Improve liveness example with array access.

* Small updates to comments.

* Disable liveness test because inconsistencies with output on CI system.

* Fix some issues brought up in PR.

* Rename liveness instructions.</content>
</entry>
</feed>
