[PATCH] D157959: [SPIRV] Share a test between DXIL & SPIRV backends

Nathan Gauër via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 03:26:55 PDT 2023


Keenuts created this revision.
Herald added subscribers: Anastasia, pmatos, ThomasRaoux.
Herald added a project: All.
Keenuts requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The SPIR-V backend is not ready yet to compile graphic shaders. So we
have no test that could pass with both backends except this one.

But in the future, we'd have 2 backends available for the HLSL
frontend: DXIL and SPIRV.
In DirectXShaderCompiler, a common source of bugs was uneven coverage
of features between both backends.
The goal here is to determine the canonical way to share tests.

The main issue is around XFAIL: in an ideal world, we could link
each XFAIL to a RUN line, but right now it's not possible.
This means we cannot mark the test as XFAIL just for 1 backend.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157959

Files:
  llvm/test/CodeGen/SPIRV/empty-module.ll


Index: llvm/test/CodeGen/SPIRV/empty-module.ll
===================================================================
--- llvm/test/CodeGen/SPIRV/empty-module.ll
+++ llvm/test/CodeGen/SPIRV/empty-module.ll
@@ -1,8 +1,12 @@
-; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
+; RUN: %if spirv-registered-target %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s --check-prefix=SPIRV-CHECK %}
+; RUN: %if directx-registered-target %{ llc -O0 -mtriple=dxil-pc-shadermodel6.0-library %s -o - | FileCheck %s --check-prefix=DXIL-CHECK %}
 
-; CHECK-DAG: OpCapability Addresses
-; CHECK-DAG: OpCapability Linkage
-; CHECK-DAG: OpCapability Kernel
-; CHECK:     %1 = OpExtInstImport "OpenCL.std"
-; CHECK:     OpMemoryModel Physical64 OpenCL
-; CHECK:     OpSource Unknown 0
+; SPIRV-CHECK-DAG: OpCapability Addresses
+; SPIRV-CHECK-DAG: OpCapability Linkage
+; SPIRV-CHECK-DAG: OpCapability Kernel
+; SPIRV-CHECK:     %1 = OpExtInstImport "OpenCL.std"
+; SPIRV-CHECK:     OpMemoryModel Physical64 OpenCL
+; SPIRV-CHECK:     OpSource Unknown 0
+
+; DXIL-CHECK: target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64"
+; DXIL-CHECK: target triple = "dxil-pc-shadermodel6.0-library"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157959.550236.patch
Type: text/x-patch
Size: 1252 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230815/c217b695/attachment.bin>


More information about the llvm-commits mailing list