[clang] [llvm] Adding splitdouble HLSL function (PR #109331)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 27 22:07:09 PDT 2024
================
@@ -3,12 +3,12 @@
// Supported targets
//
-// RUN: %clang -target dxil-unknown-shadermodel6.2-compute %s -S -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s
-// RUN: %clang -target spirv-unknown-vulkan-compute %s -S -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s
-// RUN: %clang -target spirv-unknown-vulkan1.2-compute %s -S -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s
-// RUN: %clang -target spirv-unknown-vulkan1.3-compute %s -S -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s
-// RUN: %clang -target spirv1.5-unknown-vulkan1.2-compute %s -S -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s
-// RUN: %clang -target spirv1.6-unknown-vulkan1.3-compute %s -S -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s
+// RUN: %clang -cc1 -triple dxil-unknown-shadermodel6.2-compute %s -S -disable-llvm-passes -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s
+// RUN: %clang -cc1 -triple spirv-unknown-vulkan-compute %s -S -disable-llvm-passes -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s
+// RUN: %clang -cc1 -triple spirv-unknown-vulkan1.2-compute %s -S -disable-llvm-passes -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s
+// RUN: %clang -cc1 -triple spirv-unknown-vulkan1.3-compute %s -S -disable-llvm-passes -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s
+// RUN: %clang -cc1 -triple spirv1.5-unknown-vulkan1.2-compute %s -S -disable-llvm-passes -o /dev/null 2>&1 | FileCheck --allow-empty --check-prefix=CHECK-VALID %s
----------------
joaosaffran wrote:
@bob80905, @llvm-beanz Adding [this](https://github.com/llvm/llvm-project/blob/c01675c47f8336f32c4c54387ef3e32ac43d2d0c/clang/lib/Headers/hlsl/hlsl_intrinsics.h#L444-L472) to `hlsl_intrinsics.h` broke this test.
```cpp
#elif __is_target_arch(spirv)
void asuint(double4 D, out uint4 lowbits, out uint4 highbits) {
uint4 bottom = __detail::bit_cast<uint4>(D.xy);
uint4 top = __detail::bit_cast<uint4>(D.zw);
lowbits = uint4(bottom.x, bottom.z, top.x, top.z);
highbits = uint4(bottom.y, bottom.w, top.y, top.w);
}
void asuint(double3 D, out uint3 lowbits, out uint3 highbits) {
uint4 bottom = __detail::bit_cast<uint4>(D.xy);
uint2 top = __detail::bit_cast<uint2>(D.z);
lowbits = uint3(bottom.x, bottom.z, top.x);
highbits = uint3(bottom.y, bottom.w, top.y);
}
void asuint(double2 D, out uint2 lowbits, out uint2 highbits) {
uint4 bottom = __detail::bit_cast<uint4>(D.xy);
lowbits = uint2(bottom.x, bottom.z);
highbits = uint2(bottom.y, bottom.w);
}
void asuint(double D, out uint lowbits, out uint highbits) {
uint2 bottom = __detail::bit_cast<uint2>(D);
lowbits = uint(bottom.x);
highbits = uint(bottom.y);
}
#endif
```
The error I got is: `Capability not supported: Int8` After some investigation, I suspect the error is caused by the lowering of the out parameters, since removing the keyword `out` from the function declaration resolved the issue. But I wasn't able to diagnose further than that.
I agree that the usage of `-cc1` here seems wrong. I see no issues in removing this change from the test, but I would also prefer to remove the SPIR-V lowering from this PR. Since this seems to require some redesign from our original approach or further diagnosis of the lowering process of `out` parameters.
https://github.com/llvm/llvm-project/pull/109331
More information about the llvm-commits
mailing list