| Age | Commit message (Collapse) | Author |
|
* Lower all ByteAddressBuffer uses for SPIRV.
* Misc. SPIRV Fixes.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
|
|
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
|
|
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* s/invalid code/todo
* comment debug disassembled spirv
* more convenient spirv-val output
* color spirv-val output
|
|
* Compile append and consume structured buffers to glsl.
* Fix.
* Update CI config.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* Allow loop counters to be used as constexpr arguments.
* Fix.
* Fix.
* Fix.
* Fix.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* SPIRV: Fix matrix layout tests.
* Remove spaces.
* Disable debug output.
* Fix.
* Update expected-failure list.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* fix block eater
* Be more careful about merge blocks during loop inversion
* Restrict loop inversion to loops without continue jumps
* Remove multiple back-edges from loops for SPIR-V
* Wiggle cross compile test output
* Make loop-inversion more conservative
* Allow loops on false side in cfg normalization
* Do not set loop continue block during inversion
* Add loop inversion test to failing test list for spirv
* Simplify single use continue blocks in spirv legalization
* wobble expected failure list
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Merge
* WIP: Complete auto-diff logic for existential types
* Revert "Add compiler option for generating representative hash"
This reverts commit 13b09ef4621e73844c96d64d9c111a8ed0d45aae.
* More fixes for fwd-mode AD on existential types
* Add anyValueSize inference pass
* Fix checking of `Differential.Differential==Differential`
* In-progress: infer any-value-size for existential types
* Existentials now work in forward-mode
* Overhaul handling of existential AD types. Fwd-mode works, reverse-mode requires front-end changes
* Reverse-mode now works on existentials
* Cleanup
* Remove diff rules for create existential object for now
* Revert treat-as-differentiable changes
* Fixes
* More fixes
* Cleanup
* more cleanup
* signed/unsigned
* Revert "Cleanup"
This reverts commit e4f7d71f07bb207736f90708961eeecd09a1b652.
* Cleanup (again)
* Remove public/export/keep-alive on null differential after AD pass
* Minor fix
* Update dictionary accessors
* Keep export decoration
* More fixes + Support for `kIROp_PackAnyValue`
* Merge upstream
* Update expected-failure.txt
|
|
* Create storage types of different layouts for SPIRV emit.
* Fix.
* Fix.
* Fix.
* Update expected failure list.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* Generalize collectInductionValues
* Support affine transformations of loop index as induction variables
* Test for generalized induction value collection
* Neaten inductive variable finding
* Make types more specific
* Add loop inversion pass
* Test output changes after loop inversion
* Store the type of implication success when finding inductive variables
* Test that loop induction finding does not alway succeed
* Support chains of additions and branches of additions in induction variable finding
* Use c++17 for downstream compilers
* Wiggle expected output for cross compile test after loop inversion
* Add loop inversion test
* Simplify IfElse instructions with a single trivial block
* Invert loops with a user inserted break
* Limit loop inversion to loops with a 4 instruction or less comparison block
* regenerate vs projects
|
|
|
|
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
|
|
* Remove unused variables
* Silence gcc out of bounds warnings
* Squash strict-aliasing warnings
It is still a naughty thing to be casting to T like this though
* Correct equality check when val is nullptr
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
|
|
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* Correct namespace for getClockFrequency
* missing const
* Add missing assignment operator
* Remove unused variables
* Return correct modified variable
* Use stable hash code for file system identity
* terse static_assert
* Structured binding for map iteration
* Make (==) and getHashCode const on many structs
* Add ConstIterator for LinkedList
* Replace uses of ItemProxy::getValue with Dictionary::at
* Extract list of loads from gradientsMap before updating it
* Const correctness in type layout
* Add unordered_dense hashmap submodule
* Use wyhash or getHashCode in slang-hash.h
* refactor slang-hash.h
* Use ankerl/unordered_dense as a hashmap implementation
Notable changes:
- The subscript operator returns a reference directly to the value,
rather than a lazy ItemProxy (pair of dict pointer and key)
slang-profile time (95% over 10 runs):
- Before: 6.3913906 (±0.0746)
- After: 5.9276123 (±0.0964)
* 64 bit hash for strings
So they have the same hash as char buffers with the same contents
* Narrowing warnings for gcc to match msvc
* revert back to c++17
* Correct c++ version for msvc
* Use path to unordered_dense which keeps tests happy
* Do not assign to and read from map in same expression
* Remove redundant map operations in primal-hoist
* Split out stable hash functions into slang-stable-hash.h
* 64 bit hash by default
* regenerate vs projects
* Correct return type from HashSetBase::getCount()
* correct width for call to Dictionary::reserve
* Use stable hash for obfuscated module ids
* Signed int for reserve
* clearer variable naming
* Parameterize Dictionary on hash and equality functors
* Allow heterogenous lookup for Dictionary
* missing const
* Use set over operator[] in some places
* Remove unused function
* s/at/getValue
|
|
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Add test for generic param inference bug for nested generics
* Change description & simplify test
* Add expected file
* Check parent decl before unifying type parameters
|
|
* Add type layout for structured buffer
* Default to generating spirv directly
* vk test for compute simple
* Add spirv-dis as a downstream compiler
* Emit Array types in SPIR-V
* makevector for spirv
* Dump whole spirv module on validation failure
* register array types
todo, use emitTypeInst
* Neater formatting for unhandled inst printing
* break out emitCompositeConstruct
* Correct array type generation
* neaten
* Allow getElement for vector
* Remove unused
* Allow predicating target intrinsics on types
* Consider functions with intrinsics to have definitions
We need to specialize these if they are predicated on types
* Correct array type generation
* makeArray for spir-v
* replace getElement with getElementPtr for spirv
* Correct translation of field access for spirv
* Push layouts to types for spirv
* Spirv intrinsics * operator now makes a pointer
* Add structured buffer of struct test
* Preserve type layout in spirv structured buffer legalization
* neaten
* makeVectorFromScalar for SPIRV
* placeholder for layouts on param groups
* More type safe spirv op construction
* Know that constants and types only go in one section
* Remove emitTypeInst
* Add todo for spirv sampling
* Add links to spirv documentation on emit functions
* OpTypeImage support for SPIR-V
* Add simpler texture test for spirv
* s/spirv_direct/spirv/g
* Allow several string literals in target_intrinsic
* Handle global params without a var layour for SPIR-V
For example groupshared vars
* uint spirv asm type
* Add todo for isDefinition
It is currently too broad
* Some atomic op spirv intrinsics
* Strip ConstantBuffer wrappers for spirv
* Add todo for matrix annotations
* Do not associate decorations insts with spirv counterparts
* Correct entry point parameter generation
* Spelling
* Assert that fieldAddress is returning a pointer
* Add error for existential type layout getting to spir-v emit
* Add IRTupleTypeLayout
Unused so far
* Allow getElementPtr to work with vectors
* Correct target name in test
* Hide default spirv direct behind a premake option --default-spirv-direct=true
* Do not insert space at start of intrinsic def
* Correct asm rendering in tests
* remove redundant option
* Emit directly from direct test
* Add source language options for spirv-dis
* Add comments to spirv dis
* Add dead debug print for before spirv module
* Correct asm rendering in tests
* s/spirv_direct/spirv/g
* Only specialize intrinsic functions with predicates
* regenerate vs projects
* squash warnings
* squash warnings
* remove duplication
* Silence warnings from msvc
* squash warnings
* Overload for zero sized array
* More msvc warnings
* warnings
* Add spirv-tools to path for tests
* Do not be specific about dxc version for diag test
* Normalize line endings from spirv-dis
* Correct filecheck matches
* Temporarily disable two spirv tests
Failing on CI, undebuggable hang :/
* Do not emit storage class more than once for spirv snippet
* Do not pass spir-v to spirv-dis by stdin
* Do not get spirv-dis output via stream, use file
* normalize file endings in spirv-dis output
|
|
* Add auto-diff support for `IRSwizzleStore`
- Lower IRSwizzleStore to multiple stores during AD preprocess.
- Fix typo in `transcribeNonDiffInst`
* Remove unnecessary file & add more robust check for 'local' addresses
* Fix.
* Update slang-ir-autodiff-fwd.cpp
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Support per field matrix layout
* Fix warnings.
* Fix.
* Fix tests.
* Fix spiv gen.
* Fix.
* More test fixes.
* Fix.
* Run only GPU tests on self-hosted servers.
* Remove -use-glsl-matrix-layout-modifier.
* Fix.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* Do not eliminate single-iter-loops that have inner loops using their break label.
* Add test
* Delete out-old.hlsl
* Update slang-ir-autodiff-cfg-norm.cpp
* Fix whitespace
|
|
* Make sure glsl source in spirv is included when compiling with -g3.
* Exclude vulkan tests on github linux CI.
* Fix.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
|
|
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* Add support for `ConstBufferPointer` on Vulkan.
* Add spv compilation test.
* Fix.
* Fix code review issues.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* Allow member lookup through modified type.
* Disable `lockFileSync` test.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
|
|
* Support implciit casted swizzled lvalue.
* Fix warnings.
* Fix.
* fix comment.
* Prefer mangled linkage name for global params.
* Update tests.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* Fix name mangling of modified types.
* Add `InterlockedAdd(__ref uint, int)` overload.
* Fix.
* Fix type error in ImageStore legalization.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* Clean up and improve Val deuplication performance.
* Fix.
* Fix.
* Fix.
* Fix.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* Support `-fvk-use-gl-layout` for ByteAddressBuffer load/store.
* Fix.
* Fix.
* Add test for unaligned load.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
By default, function parameters in HLSL are mutable, but any changes to a parameter do not affect the values of the arguments after a call:
void f(int a)
{
a++; // allowed, but kind of useless
}
...
int b = 0;
f(b);
// b is still zero
Because the above behavior is a part of HLSL, we cannot easily diagnose such cases as errors without breaking backward compatibility with existing code.
This change makes it an error to invoke a `[mutating]` method on a function parameter, which cannot affect backward compatibility since the notion of `[mutating]` methods is not present in existing HLSL code:
struct Counter
{
int _state;
[mutating] void increment() { _state++; }
}
void f(Counter a)
{
a.increment(); // ERROR
}
...
Counter b = { 0 };
f(b);
// b is still zero
The compiler will also diagnose calls to `[mutating]` methods on a field or array element extracted out of a function parameter.
This change does not affect code that directly mutates a function parameter via assignment, or via passing the parameter onward as an argument to an `out` or `inout` call (or, equivalently, as the left-hand operand to a compound assignment operator).
This is a breaking change to existing Slang code, since it could diagnose an error on code that used to be allowed.
Indeed, two tests in the Slang test suite had to be updated to avoid such errors.
It would be possible to turn this diagnostic into a warning, and simply encourage users to enable it as an error.
On balance, though, it seems best to not allow this idiom since it has such a high probability to be an error.
Note: the specific case that motivated this change is use of `RayQuery` values as function parameters.
The root of the problem there is that dxc treats `RayQuery` values as copyable handles to mutable state, while Slang prefers to capture the mutation that occurs through marking the appropriate methods as `[mutating]`.
The Slang approach makes portable codegen for D3D/Vulkan simpler, but requires that we *also* treat a type like `RayQuery` as non-copyable.
This change does not address the problem that the Slang compiler does not enforce the requirement that values of non-copyable types do not get copied.
Instead, the diagnostic here just happens to issue a diagnostic in one important case where a copy would typically occur.
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Add spirv-dis as a downstream compiler
* Add TODO for spirv-dis downstream compiler
* Do not use SpirvDis by default
* tabs to spaces
* regenerate vs projects
* correct test
* correct calling convention
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Default target intrinsic should not apply to SPIR-V
* CapabilitySet is a conjunction
* Add TEXTUAL_SOURCE capability class
|
|
* Fix -fvk-use-entrypoint-name.
* Remove irrelevant changes.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
* Validate generated SPIR-V
* regenerate vs projects
* Do not fail compiles if spirv-val is not available
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
Types can depend on constants (for example fixed sized arrays)
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* types for cast instructions
* Information getting functions for int and float types
* Implement spirv casting
* Broadcast operands for SPIR-V arithmetic
SPIR-V doesn't allow vector/sclar arithmetic ops
* Simplify spirv int/float type generation
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
Required for memcpy (not sure why this has started being important, but it is the correct thing to do)
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Fail on an unhandled spv operand
* Diagnose on emitting a function with no definition or intrinsic
* clearer error message
* Add assert
* Add assert
* remove unused assert
* Disagnostic on snippet parsing failure
* Mention unimplemented instruction in error message
* mention unhandled local instruction for spirv in error message
* Allow specifying dump options in dumpIRToString
---------
Co-authored-by: Yong He <yonghe@outlook.com>
|
|
* Fix `Val` deduplication bug.
* Fix
* Concat stdlib files into a single module.
* Remove unnecessary logic in `resolve`.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
|
|
|
|
* Add TokenReader::AdvanceIf overlaod for TokenType
* Add some spirv defs to parser
* Add comment
|
|
|
|
|