================
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple \
+// RUN: dxil-pc-shadermodel6.3-compute %s -emit-llvm -disable-llvm-passes -o
- | \
+// RUN: FileCheck %s --check-prefixes=CHECK,CHECK-DXIL
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple \
+// RUN: spirv-pc-vulkan-compute %s -emit-llvm -disable-llvm-passes -o - | \
+// RUN: FileCheck %s --check-prefixes=CHECK,CHECK-SPIRV
+
+// Test basic lowering to runtime function call.
+
+// CHECK-LABEL: test_uint
+uint test_uint(uint expr) {
+ // CHECK-SPIRV: %[[RET:.*]] = call spir_func [[TY:.*]]
@llvm.spv.wave.reduce.or.i32([[TY]] %[[#]])
----------------
farzonl wrote:
see `clang/test/CodeGenHLSL/builtins/dot.hlsl` that should let you use CHECK
for most of your intrinsics so we don't have to do so many seperate SPIRV vs
DX checks.
should look something like this for the first one
// DXCHECK: %na,e = call <type> @llvm.[[ICF:dx]].<intrinsic_name>.<type>(..
// SPVCHECK: %name = call <type> @llvm.[[ICF:spv]].<intrinsic_name>.<type>(...
https://github.com/llvm/llvm-project/pull/165156
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits