[llvm] [DXIL] Model DXIL Class and Shader Model association of DXIL Ops in DXIL.td (PR #87803)

S. Bharadwaj Yadavalli via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 10 10:48:01 PDT 2024


================
@@ -1,25 +1,23 @@
-; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
+// Shader Mode 6.0
+// RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.0-library %S/Inputs/sin/half.ll 2>&1 | FileCheck %s -check-prefix=SM6_0_HALF
+// RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.0-library %S/Inputs/sin/float.ll | FileCheck %s -check-prefix=SM6_0_FLOAT
+// RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.0-library %S/inputs/sin/double.ll 2>&1 | FileCheck %s --check-prefix=SM6_0_DOUBLE
----------------
bharadwajy wrote:

> I'm not a fan of separating the inputs from the test logic. Probably best to simply have three separate tests.

It appears to me that there would be test sources that are expected to pass for some set of target options (such as shader model versions and shader kinds) but are expected to fail for other set of target options. I believe it would be good to have a **single** copy of tests and a separate file that specifies the run commands according to the expectation of them to pass or fail. 

I think that would be a clean specification as opposed to maintaining multiple copies of the same test - one or more for each of the expected passing and failing cases. For example, `sin/half.ll` test is expected to pass for SM >= 6.2 but fail for SM >= 6.0 and < 6.2. When the test parameter set grows from one element (currently just SM) to include others, this kind of separation would be easy to maintain.

https://github.com/llvm/llvm-project/pull/87803


More information about the llvm-commits mailing list