[all-commits] [llvm/llvm-project] f368e6: [SPIR-V] Add SPIRV-Tools for testing (#73044)

Natalie Chouinard via All-commits all-commits at lists.llvm.org
Mon Dec 4 09:25:04 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f368e6424fbfb7fdea4b9d9a2e44f2f7e188c133
      https://github.com/llvm/llvm-project/commit/f368e6424fbfb7fdea4b9d9a2e44f2f7e188c133
  Author: Natalie Chouinard <sudonatalie at google.com>
  Date:   2023-12-04 (Mon, 04 Dec 2023)

  Changed paths:
    M llvm/test/CMakeLists.txt
    A llvm/test/CodeGen/SPIRV/OpVariable_order.ll
    M llvm/test/CodeGen/SPIRV/basic_int_types.ll
    A llvm/test/CodeGen/SPIRV/basic_int_types_spirvdis.ll
    M llvm/test/CodeGen/SPIRV/lit.local.cfg
    M llvm/test/lit.site.cfg.py.in
    A llvm/tools/spirv-tools/CMakeLists.txt

  Log Message:
  -----------
  [SPIR-V] Add SPIRV-Tools for testing (#73044)

Add spirv-dis (disassembler) and spirv-val (validator) from SPIRV-Tools
as external dependencies for testing the SPIR-V backend. These tools are
test dependencies only.

SPIR-V backend tests now have a dependency on the spirv-dis and
spirv-val targets when the `LLVM_INCLUDE_SPIRV_TOOLS_TESTS` cmake
variable is set, which allows additional test files with the `REQUIRES:
spirv-tools` constraint to run, along with additional `RUN: %if
spirv-tools ...` lines in existing tests. All other SPIR-V backend tests
will run normally when `LLVM_INCLUDE_SPIRV_TOOLS_TESTS` is not set.

Several tests are included to show these tools' use, however more tests
will be migrated and added later.
* OpVariable_order.ll shows how spirv-val can catch bugs in the backend.
* basic_int_types_spirvdis.ll shows how tests can be much shorter and
more readable by FileChecking the spirv-dis output.
* basic_int_types.ll shows how an additional RUN line can add validation
to existing tests.

RFC:
https://discourse.llvm.org/t/rfc-add-a-test-dependency-on-spirv-tools/75135




More information about the All-commits mailing list