We replace getting the id of a poitner type with a specific funciton
call to FindPointerToType. Also, FindPointerToType is updated to not
indirectly call GetId. This leads to a linear search for an existing
type in all cases, but it is necessary.
Note that this function could have a similar problem. There could be two
pointer types with the same pointee and storage class, and the first one
will be returned. I have checked the ~20 uses, and they are all used in
situations where the id is used to create something new, and it does not
have to match an existing type. These will not cause problems.
Part of #5691
* Avoid use of type manager in extact->construct folding
When dealing with structs the type manager merge two different structs
into a single entry if they have all of the same decorations and
element types. This is because they hash to the same value in the hash
table. This can cause problems if you need to get the id of a type from
the type manager because you could get either one. In this case, it
returns the wrong one.
The fix avoids using the type manager in one place. I have not
looked closely at other places the type manager is used to make
sure it is used safely everywhere.
Fixes#5624
* Remove use of TypeManager::GetId
This removes a use of TypeManager::GetId by keeping the id around. This
avoid a potential problem if the type manager gets confused. These types
of bugs are hard to generate test cases for, so I do not have a test.
However, existing tests make sure that do not regress.
The last three elements in the list of supported targets were
misaligned:
```
Targets:
SPIR-V 1.0
SPIR-V 1.1
...
SPIR-V 1.3 (under Vulkan 1.1 semantics)
SPIR-V 1.4 (under Vulkan 1.1 semantics)
SPIR-V 1.5 (under Vulkan 1.2 semantics)
SPIR-V 1.6 (under Vulkan 1.3 semantics)
```
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Basic support for SPV_EXT_replicated_composites
Validation will follow as a separate PR (still need to write a test suite)
Change-Id: Ic95fa6ce39d32f5ac2787bc38dba2748c9cc58f7
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
* Update SPIRV-Headers
Change-Id: I6c0df248d99c13b49d78528d035a4222027c0232
---------
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
This removes the folding rules added in #4783 and #4808. They lead to
poor code generation on Adreno devices when 16-bit floating point values
were used. Since this change is transformation is suppose to be neutral,
there is no general reason to continue doing it.
I have talked to the owners of SwiftShader, and they do not mind if the
transform is removed. They were the ones the requested the change in the
first place.
Fixes#5658
The autoroller does not update abseil, and that it stopping us from
updating RE2. This change will update the auto roller, then the next
time it runs, we should be able to update everything.
The Scope operand of `OpReadClockKHR` was always validated using the
Vulkan environment rules, which only allow `Subgroup` or `Device`.
For the OpenCL environment, `Workgroup` is also a valid Scope, so
`Workgroup` should not be rejected in the universal environment.
Guard the existing Scope check behind `spvIsVulkanEnv` and add a new
Scope check for the OpenCL environment.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Check for matrix decorations on arrays of matrices
* MatrixStide, RowMajor and ColMajor can be applied to matrix or
arrays of matrix members
* Check that matrix stride satisfies alignment in arrays
Reject `OpCooperativeMatrixStoreKHR` with a `MakePointerVisibleKHR`
MemoryAccess operand, as `MakePointerVisibleKHR` is not supposed to be
used with store operations.
The `CoopMatKHRStoreMemoryAccessFail` test failed to catch this
because it used the helper function `GenCoopMatLoadStoreShader` which
generates `...NV` instead of `...KHR` instructions. Add a new helper
function to generate similar shaders for the KHR extension, as the NV
and KHR extensions have various subtle differences that makes
parameterizing the original helper function non-trivial.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
In contrast to the C API, the C++ API did not have symbol visibility
specified. An application using the C++ API would fail to link
against a shared SPIRV-Tools library built with `-fvisibility=hidden`.
Mark all classes in the public `.hpp` files with `SPIRV_TOOLS_EXPORT`.
Add `SPIRV_TOOLS_LOCAL` to hide nested structs containing
implementation details.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Disallow duplicate decorations generally
* Only FuncParamAttr and UserSemantic can be applied to the same target
multiple times
* Unchecked: completely duplicate UserSemantic and FuncParamAttr
* Disallow duplicate execution modes generally
* Exceptions for float controls, float controls2 and some intel
execution modes
* Fix invalid fuzzer transforms
This fixes the problem reported in #5623 using the observation that if
we are re-building a type that already exists in the type pool, we
should just return that type.
This makes type rebuilding more efficient, and it also prevents the
type builder from getting itself into infinite recursion (as reported in
this issue).
In fixing this, I found a couple of other bugs in the type builder:
- When rebuilding an Array type, we were not re-building the element
type. This caused stale type references in the rebuilt type.
- This bug had not been caught by the test, because the test itself had
a bug in it: the test was rebuilding types on top of the same ID (the
ID counter was never incremented).
Initially, the bug in the test caused a failure with the new logic in
the builder because we now return types from the pool directly, which
causes a failure when two incompatible types are registered under the
same ID.
Fixing that issue in the test exposed another bug in the rebuilder: we
were not re-building the element type for Array types. This was causing
a stale type reference inside Array types which was later caught by the
type removal logic in the test.
GitHub releases were just the exact same as the LunarG releases,
since the same commit were used for both.
For this reason, we don't think it brings any value, and will stop
publishing new releases on the GitHub page.
Signed-off-by: Nathan Gauër <brioche@google.com>
6598a8ecd5...917047f360
$ git log 6598a8ecd..917047f36 --date=short --no-merges --format='%ad %ae %s'
2024-03-28 junyer Tell Bazel the specific target version of macOS too. Sigh.
2024-03-28 junyer Force a specific target version of macOS.
2024-03-28 junyer Prepare to tag release `2024-04-01`.
Created with:
roll-dep external/re2
Co-authored-by: GitHub Actions[bot] <>
* Roll external/googletest/ b479e7a3c..c231e6f5b (1 commit)
b479e7a3c1...c231e6f5b1
$ git log b479e7a3c..c231e6f5b --date=short --no-merges --format='%ad %ae %s'
2024-03-14 absl-team Add test for move-only type in `Action` signature
Created with:
roll-dep external/googletest
* Roll external/re2/ 108914d28..db46d1e11 (3 commits)
108914d28a...db46d1e11e
$ git log 108914d28..db46d1e11 --date=short --no-merges --format='%ad %ae %s'
2024-03-17 junyer Bump versions of actions to latest releases.
2024-03-17 junyer Fix the link to the Python wrapper.
2024-03-15 oleksandr.red+github doc/mksyntaxgo: use standard generated Go header
Created with:
roll-dep external/re2
---------
Co-authored-by: GitHub Actions[bot] <>
* Roll external/googletest/ 5df0241ea..b479e7a3c (11 commits)
5df0241ea4...b479e7a3c1
$ git log 5df0241ea..b479e7a3c --date=short --no-merges --format='%ad %ae %s'
2024-03-11 dcheng Guard Abseil flags usage in googlemock with GTEST_NO_ABSL_FLAGS.
2024-03-07 absl-team Reland: Optimize Google Test process startup
2024-03-05 absl-team Revert Optimize Google Test process startup
2024-03-05 absl-team Optimize Google Test process startup
2024-02-29 absl-team Accept one-shot callables in InvokeArgument.
2024-02-27 absl-team Reland 9756ee7cba
2024-02-27 absl-team Make sure that current_test_suite and current_test_info are mutex-protected while writing for thread-safety.
2024-02-23 tmiguelf Fixed gcc linker error 58
2024-02-22 absl-team Revert incorrect update.
2024-02-21 dmauro Rollback 9756ee7cba
2024-02-11 155268264+danfabo Get include dirs from target rather than global variables.
Created with:
roll-dep external/googletest
* Roll external/re2/ dbf15a205..108914d28 (3 commits)
dbf15a205c...108914d28a
$ git log dbf15a205..108914d28 --date=short --no-merges --format='%ad %ae %s'
2024-03-11 junyer `p0deje/setup-bazel` has been transferred to `bazel-contrib`.
2024-03-11 junyer Add Clang 18 to the build matrix.
2024-03-07 junyer Delete an old comment.
Created with:
roll-dep external/re2
---------
Co-authored-by: GitHub Actions[bot] <>
* Use bazel 7 and bzlmod
Many of our dependencies are now using bazel 7 and the new bzlmod module
system. This has been breaking our autoroll; this PR should fix the
issues we've been having with that.
It may or may not be worthwhile to update effcee to use bzlmod as well;
this would let us get rid of WORKSPACE entirely.
* Try to force cla check to rerun
All tests treat kAnalysisEnd like STL end iterators, which
means its value must be greater than that of the last valid
Analysis.
Change-Id: Ibfaaf60bb450c508af0528dbe9c0729e6aa07b3b
Signed-off-by: Kevin Petit <kevin.petit@arm.com>