Skip to content

Conversation

@s-perron
Copy link
Owner

VishMCW and others added 30 commits April 2, 2025 10:10
…L_masked_gather_scatter (KhronosGroup#6041)

* Support pointer base type in OpTypeVector when capability
MaskedGatherScatterINTEL is enabled
Add supporting tests for spv_intel_masked_gather_scatter

Co-authored-by: alan-baker <[email protected]>
…hronosGroup#6078)

When checking if a variable is possibly stored to, debug instructions
fall into the default case, which assumes it could be a store. We add a
specific check for debug instruction, which are not stores.

See microsoft/DirectXShaderCompiler#7181
)

The validation added in KhronosGroup#6000 seems specific to Vulkan environments.
Ensure it only runs for Vulkan environments.

Signed-off-by: Sven van Haastregt <[email protected]>
* Roll external/abseil_cpp/ bcf4bf315..c8d5854f0 (18 commits)

abseil/abseil-cpp@bcf4bf3...c8d5854

Created with:
  roll-dep external/abseil_cpp

* Roll external/spirv-headers/ 8c88e0c4c..8e82b7cfe (1 commit)

KhronosGroup/SPIRV-Headers@8c88e0c...8e82b7c

Created with:
  roll-dep external/spirv-headers

---------

Co-authored-by: GitHub Actions[bot] <>
…updates (KhronosGroup#6083)

Bumps the github-actions group with 2 updates in the / directory: [lukka/get-cmake](https://github.com/lukka/get-cmake) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `lukka/get-cmake` from 3.31.6 to 4.0.0
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](lukka/get-cmake@56d043d...28983e0)

Updates `github/codeql-action` from 3.28.13 to 3.28.15
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@1b549b9...45775bd)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-version: 3.28.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add SPV_KHR_bfloat16 support

* Update DEPS to include SPIRV-Headers with bfloat16 support

* Fix unit test errors and format

* Add validation to invalid uses of bfloat16

* Add tests

* Roll back to previous commit

* Fix build error

* Add FPEncoding for opt::analysis::Float

* Address the comments

* Fix build error

* format

---------

Co-authored-by: Stu Smith <[email protected]>
Co-authored-by: David Neto <[email protected]>
* Added support for global OpUntypedVariableKHR in IRLoader
* Added support for untyped pointers as Pointer types using a null
  element
  * Updates to type manager
* No specific pass allowances yet, but untyped pointers no longer break
  the whole pipeline
…oup#6086)

* Roll external/googletest/ 52204f78f..e90fe2485 (2 commits)

google/googletest@52204f7...e90fe24

Created with:
  roll-dep external/googletest

* Roll external/abseil_cpp/ c8d5854f0..8b81b77c5 (14 commits)

abseil/abseil-cpp@c8d5854...8b81b77

Created with:
  roll-dep external/abseil_cpp

* Roll external/spirv-headers/ 8e82b7cfe..7c2f5333e (2 commits)

KhronosGroup/SPIRV-Headers@8e82b7c...7c2f533

Created with:
  roll-dep external/spirv-headers

---------

Co-authored-by: GitHub Actions[bot] <>
* Add Vulkan 1.3 and 1.4 capability checks

Fixes KhronosGroup#6050

* formatting

* add missed caps
…sGroup#6089)

Bumps the github-actions group with 1 update: [lukka/get-cmake](https://github.com/lukka/get-cmake).


Updates `lukka/get-cmake` from 4.0.0 to 4.0.1
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](lukka/get-cmake@28983e0...57c20a2)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-version: 4.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
These should not require the Float16/Float16Buffer capabilities.


Change-Id: I3b50260ba634502befb36b6a67dac5961f102fa3

Signed-off-by: Kevin Petit <[email protected]>
…oup#6091)

* Roll external/googletest/ e90fe2485..155b337c9 (1 commit)

google/googletest@e90fe24...155b337

Created with:
  roll-dep external/googletest

* Roll external/abseil_cpp/ 8b81b77c5..8b2b78bb9 (14 commits)

abseil/abseil-cpp@8b81b77...8b2b78b

Created with:
  roll-dep external/abseil_cpp

* Roll external/spirv-headers/ 7c2f5333e..aa6cef192 (1 commit)

KhronosGroup/SPIRV-Headers@7c2f533...aa6cef1

Created with:
  roll-dep external/spirv-headers

---------

Co-authored-by: GitHub Actions[bot] <>
Update the changes. DEPS will be updated by
KhronosGroup#6091.
…onosGroup#6094)

* generate_grammar_tables.py: remove unused option to emit C enums

Remove the ability to emit C declarations for core instruction and
operand tables.

Non-functional change

* Update build_defs.bzl
If values are not whole number, then the result is not 0. For example,
`(1.5 % 1.0) == 0.5`.

Fixes KhronosGroup#6097
This allows something like: "Copyright 2025 Google LLC"

Also:
- update the current year.
- properly escape \ in the Python regular expression strings
It's a subset of C++20's std::span, but only using C++17 features.
It's a span, but without the base pointer.

Use the 'apply' method on a base pointer to generate a corresponding span.
Generate glsl.std.450 and opencl.std.100 extended instruction tables
the same way other vendor extended instruction tables are generated.

The naming is a little weird, but I wanted to keep this patch simple
because it touches so many build systems.

Also:
- Don't always assume operand_kinds exists
…oup#6101)

* Roll external/googletest/ 155b337c9..cd430b47a (1 commit)

google/googletest@155b337...cd430b4

Created with:
  roll-dep external/googletest

* Roll external/abseil_cpp/ 8b2b78bb9..fe5a2a441 (17 commits)

abseil/abseil-cpp@8b2b78b...fe5a2a4

Created with:
  roll-dep external/abseil_cpp

* Roll external/spirv-headers/ aa6cef192..bab63ff67 (1 commit)

KhronosGroup/SPIRV-Headers@aa6cef1...bab63ff

Created with:
  roll-dep external/spirv-headers

---------

Co-authored-by: GitHub Actions[bot] <>
…hronosGroup#6102)

Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.28.15 to 3.28.16
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@45775bd...28deaed)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
When doing the clang format check, the current branch is compared with
main to see which files changed, and if there are any formating issues
in those files. This can cause false positives if the current branch is
too far behind main. If another PR fixed the formating in main, then
that will be flagged as an error because it looks like the current PR
will undo that change.

The fix is to use the merge-base for main and HEAD to find the first
common ancestor of the two to determine which files are changed in the
current branch.
Until now, the Float16 capability was reported as not allowed under
the various OpenCL environments.

Signed-off-by: Sven van Haastregt <[email protected]>
New validation check in spir-val can identify invalid code generated by DXC.
This will generally only be caught when DXC or SPIR-V tools is imported into
Google3. This can take a while. Adding the smoke test will enable us to get an
early warning that DXC needs to be updated.
dneto0 and others added 19 commits April 30, 2025 17:32
…onosGroup#6107)

* Use compressed grammar tables for core instructions and operands

Use a new 'utils/ggt.py' script to generate the compressed tables.

- The new tables are created at build time, and there is one static
  global table for each of the following:
  - a strings table
  - an instruction description table, sorted by opcode
    Each entry is a spvtools::InstructionDesc object.
  - an instruction name to opcode table, sorted by string name
    This includes aliases.
  - an operand description table, sorted by (operand type, operand value)
    Each entry is a spvtools::OperandDesc object.
  - an operand name table, sorted by (operand type, string name)
    This includes aliases.
  - a table of string aliases
  - a table of capabilities
  - a table of extensions

- Entries in the tables use IndexRanges to refer to sequences of
  objects in one of the other tables.
   - A string encoded as an IndexRange into the global strings table.
   - A sequence of capabilities is encoded as an IndexRange into
     the capabilities table.
   - A sequence of extensions is encoded as an IndexRange into
     the extensions table.
   - A sequence of aliases is encoded as an IndexRange into
     the aliases table.
   - Each entry in the aliases table is an IndexRange into the
     global string table.

- The InstructionDesc object has scalar values such as opcode,
  hasResult, hasValue, and uses IndexRanges to express the
  opcode name, aliases, operands, capabilities, operands, and
  extensions.

- The OperandDesc object has scalar values such as enum value,
  and uses IndexRanges to express the operand name, aliases, operands,
  capabilities, operands, and extensions.

Remaining work:
- Use compressed tables for extension enums and extended instruction
  sets.
- At that point, the old utils/generate_grammar_tables.py will be
  obsolete and we can move ggt.py into it.

Bug: crbug.com/413723100

* Fix Android.mk dependency on core_tables.inc

* Apply fixes from review

- fix typos
- to test for failure check SPV_SUCCESS != ...
- fix formatting

Co-authored-by: alan-baker <[email protected]>

---------

Co-authored-by: alan-baker <[email protected]>
- Fix build.gn for recent updates in table generation

- GLSL and OpenCL extended instructions are generated like
  other vendor extended instruction sets

- Core table generation was reworked.  We don't need a GN template.

- Add more constructors for InstructionDesc and OperandDesc.
  The compiler didn't like the brace-initialization without a matching
  constructor with exactly the same parameters.
…6118)

The compressed tables content now goes to:

  core_tables_headers.h, included by table2.h
  core_tables_body.h, included by table2.cpp

Fixes: KhronosGroup#6067
- Use the core grammar tables for extension enum lookup by value and
  string.
- Remove CapabilityToString, as it was no longer used.
…oup#6114)

google/googletest@cd430b4...90a4152

Created with:
  roll-dep external/googletest

Roll external/abseil_cpp/ fe5a2a441..4eb1e49cf (6 commits)

abseil/abseil-cpp@fe5a2a4...4eb1e49

Created with:
  roll-dep external/abseil_cpp

Roll external/effcee/ 874b47102..abcaf70f2 (1 commit)

google/effcee@874b471...abcaf70

Created with:
  roll-dep external/effcee

Co-authored-by: GitHub Actions[bot] <>
Chromium bans static initializers of class objects.

Wrap the std::array static variables with a function
that returns a reference to them.
This is option 2 to remove static initializers, at
https://chromium.googlesource.com/chromium/src.git/+/HEAD/docs/static_initializers.md#Removing-Static-Initializers

Also, lookup methods update a pointer-to-const pointer.
Update spirv-headers and modify MODULE.bazel to make it work.
* no static initializers

Chromium bans static initializers of class objects.

Wrap the std::array static variables with a function
that returns a reference to them.
This is option 2 to remove static initializers, at
https://chromium.googlesource.com/chromium/src.git/+/HEAD/docs/static_initializers.md#Removing-Static-Initializers

Also, lookup methods update a pointer-to-const pointer.

* Fix GN build for ggt.py modules
This avoids the C++ global initializers by making the
constructors for OperandDesc and InstructionDesc constexpr.
In turn, the std::array static variables over those types
can be initialized at compile time, not at runtime.

This also avoids the implied mutex inside the function bodies.
Also:

- spv_context no longer contains tables.

- AssemblyGrammar is never invalid anymore, so remove
  its isValid method.

- Remove unused uses of AssemblyGrammar, e.g. in the disassembler.

- Remove unused parameters

- Fix buildifier advice
  - macros should have a name keyword argument, by convention
  - functions should have docstrings

Bug: crbug.com/413723831

Co-authored-by: alan-baker <[email protected]>
During table generation, generate the by-value table first,
and remember the index at which a particular opcode or operand
enum value is stored. Then use that directly in the name lookup
tables.  This avoids a second lookup.

Fixed: crbug.com/415377082
* Roll external/abseil_cpp/ 4eb1e49cf..9a89ea871 (20 commits)

abseil/abseil-cpp@4eb1e49...9a89ea8

Created with:
  roll-dep external/abseil_cpp --update-readme

* Roll external/spirv-headers/ 3786ee89d..6d0784e9f (4 commits)

KhronosGroup/SPIRV-Headers@3786ee8...6d0784e

Created with:
  roll-dep external/spirv-headers --update-readme

* Roll external/effcee/ abcaf70f2..8ce15c424 (1 commit)

google/effcee@abcaf70...8ce15c4

Created with:
  roll-dep external/effcee --update-readme

---------

Co-authored-by: GitHub Actions[bot] <>
Debug instructions for a function scope variable may appear before the
store. We use the store as the insertion point for a new access change
to the source variable assuming all uses of the variable are dominated
by the store. This causes problems for the debug instruction. It will
then receive an operand that has not been defined.

The fix this we move the debug instruction to after the new access chain
if necessary. We opt for this option because:

1. We did not want to avoid doing the optimization because of debug
   information.
2. There is no other reasonable place to insert the access chain. If we
   move it to the start of the entry block, some operands may not be
defined, and may not be available. If we put it anywhere else, we
potentially get the same problem as we currently have with the store.
3. Moving the debug value or debug declare instructions are not a
   problem. Before the store the varible was undefined, so the debug
information would not enable any useful information in the debugger
anyway.

Fixes microsoft/DirectXShaderCompiler#7025
@s-perron s-perron closed this May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.