<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/slang/slang-ir-strip.cpp, 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>2025-10-10T06:27:57+00:00</updated>
<entry>
<title>Update debug var when in-param proxy var is being updated. (#8671)</title>
<updated>2025-10-10T06:27:57+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-10-10T06:27:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=cd50974490b82dd7e0f9ac0dd5ce9c17e390ff1f'/>
<id>urn:sha1:cd50974490b82dd7e0f9ac0dd5ce9c17e390ff1f</id>
<content type='text'>
Closes #8664.

The problem is that when there is an `in` parameter, Slang will create a
local variable to proxy the parameter, copy the value of the parameter
into the proxy variable, and replace all uses of the parameter in the
function body to use the proxy variable instead. This way all writes to
the parameter become writes to the proxy variable.

However, when there is debug info enabled, we are also going to create a
"debugVariable" corresponding to the parameter, but this debugVariable
isn't updated when the proxy variable is updated. The fix is to map the
proxy var instead of the original param to the debug var during the
`insertDebugValueStore` pass, so that any changes to the proxy var will
result in additional stores being inserted to the debug var.

Allowing function body to modify an `in` parameter is a bad legacy
behavior we inherited from HLSL that we should really be moving away
from. I would like us to completely treat an `in` parameter as immutable
by default in the next language version (Slang 2026), and make it an
error if the user tries to do so. This will allow us to generate much
cleaner code and in many cases would help with performance.</content>
</entry>
<entry>
<title>Improve performance when compiling small shaders. (#6396)</title>
<updated>2025-02-23T18:31:05+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-02-23T18:31:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=51ad07d1fbffd41c758eba172aa77ebba3204924'/>
<id>urn:sha1:51ad07d1fbffd41c758eba172aa77ebba3204924</id>
<content type='text'>
Improve performance when compiling small shaders.

Avoid copying witness table entries that are not getting used during linking.
Avoid copying auto-diff related decorations and derivative functions during linking, if the user modules doesn't use autodiff.
Cache operator overload resolution results on global session, so each new Session doesn't need to repetitively run through overload resolution from scratch.</content>
</entry>
<entry>
<title>Move switch statement bodies to their own lines (#5493)</title>
<updated>2024-11-05T17:47:26+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2024-11-05T17:47:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=b118451e301d734e3e783b3acdf871f3f6ea851c'/>
<id>urn:sha1:b118451e301d734e3e783b3acdf871f3f6ea851c</id>
<content type='text'>
* Move switch statement bodies to their own lines

* format

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<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>Add an accessor for IRInst opcode (#1707)</title>
<updated>2021-02-16T19:48:21+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2021-02-16T19:48:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e474c4e3aadc22a1b9f9b006104409f10936244f'/>
<id>urn:sha1:e474c4e3aadc22a1b9f9b006104409f10936244f</id>
<content type='text'>
* Add an accessor for IRInst opcode

This main changing is renaming `IRInst::op` over to `IRInst::m_op` and then adds an accessor `IRInst::getOp()` to read it. The rest of the changes are just changing use sites to `getOp` (or to `m_op` in the limited cases where we write to it).

This work is in anticipation of a future change that might need to store an extra bit in the same field as the opcode. It seemed better to do this massive refactoring as a separate PR.

* fixup</content>
</entry>
<entry>
<title>Feature/obfuscate improvements (#1107)</title>
<updated>2019-11-06T14:01:32+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2019-11-06T14:01:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=2e1be5c5731d93d84c3c1a25c9bfe8c1669a5d29'/>
<id>urn:sha1:2e1be5c5731d93d84c3c1a25c9bfe8c1669a5d29</id>
<content type='text'>
* Added RiffReadHelper

* Move type to fourCC in Chunk simplifies some code.

* Make MemoryArena able to track external blocks.
Allow ownership of Data to vary.
Changed IR serialization to use moved allocations to avoid copies.

As it turns out all of the array writes could use unowned data, but doing so requires the IRData to stay in scope longer than IRSerialData, which it does at the moment - but perhaps needs better naming or a control for the feature.

* Write out slang-module container.

* WIP on -r option.
Loading modules - with -r.

* Making the serialized-module run (without using imported module).

* Split compiling module from the test.

* Separate module compilation with a function working.

* Remove serialization test as not used.

* Fix warning on gcc.

* Updated test to have types across module boundary.

* Allow entry point declaration.
A test that tries to build with just an entry point declaration and a module.

* Try to make link work with multiple modules.

* Multi module linking first pass working.

* Multi module test working with -module-name option

* Added feature to repro manifest of approximation of command line that was used.

* Use isDefinition - for determining to add decorations to entry point lowering.

* Added support for repo-file-system.h
More precise control of CacheFileSystem.
Allow RelativeFileSystem to strip paths optionally.
Use canonical paths in PathInfo cache.
Fix bug in -D options for command line output of StateSerailizeUtil

* Add missing slang-options.h

* Fix bug in bit slang-state-serialize.cpp with bit removal.

* Added documentation around -repro-file-system
Added spLoadReproAsFileSystem function.

* Fix warning.

* spAddLibraryReference

* * Add support for slang-lib extension
* Container output when using -no-codegen option

* Use the m_containerFormat to determine if the module container is constructed.
Store the result in a blob. This allows for potential access via the API.
Write the blob if a filename is set.
Use m_ prefix for container variables.

* Added spGetContainerCode.
Made spGetCompileRequestCode work.

* * Put obfuscateCode on linkage
* Remove obfuscation from variable names - as can be achieved by either stripping and/or removing NameHintDecorations at lowering
* Remove name hints being added during lowering
* Add stripping of SourceLoc location in strip phase

* Hashing of linkage import/export names.

* Do final strip in emitEntryPoint, removes any remaining SourceLoc.
</content>
</entry>
<entry>
<title>Strip IR after front-end steps are done (#1092)</title>
<updated>2019-10-24T19:18:34+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2019-10-24T19:18:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=58ad4b1a9ca43098a071c42bd752a4a48405bf0e'/>
<id>urn:sha1:58ad4b1a9ca43098a071c42bd752a4a48405bf0e</id>
<content type='text'>
* Strip IR after front-end steps are done

The main feature of this change is to unconditonally strip out the `IRHighLevelDeclDecoration`s in an IR module once the "mandatory" IR passes in the front end have run. This ensures that later IR passes (e.g., code emission) *cannot* rely on AST-level information to get their job done.

Since I was already writing a pass to remove some instructions at the end of the front-end passes, I went ahead and also made the `-obfuscate` flag apply to the front-end IR generation by causing it to strip `IRNameHintDecoration`s while it is doing the other stripping. With this, the main identifying information left in IR modules (other than semantics and entry-point names) is mangled name strings for imported/exported symbols.

A few other things got changes along the way:

* Removed the `.expected` file for one of the tests, where that file seemingly shouldn't have been checked in at all.

* Updated the signature of the DCE pass both so that it doesn't require a back-end compile request (it wasn't using it anyway), and so that it takes some options to decide whether to keep symbols marked `[export(...)]` alive (the front-end wants to keep these, while back-end passes currently need to be able to eliminate them).

* Moved the `obfuscateCode` flag from the back-end compile request to the base class shared between front- and back-end requests, and updated the options and repro logic to set both as needed. An obvious improvement in the future would be to have the front- and back-end requests share these settings by referencing a single common object in the end-to-end case, rather than each having their own copy.

* Removed logic that was keeping layout instructions alive in DCE, even if they weren't used. This seems to have been a vestige of an intermediate step between AST and IR layout.

* fixup: add the new files
</content>
</entry>
</feed>
