================
@@ -0,0 +1,46 @@
+// 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_int
+int test_int(int expr) {
+  // CHECK-SPIRV:  %[[RET:.*]] = call spir_func [[TY:.*]] 
@llvm.spv.quad.read.across.y.i32([[TY]] %[[#]])
+  // CHECK-DXIL:  %[[RET:.*]] = call [[TY:.*]] 
@llvm.dx.quad.read.across.y.i32([[TY]] %[[#]])
+  // CHECK:  ret [[TY]] %[[RET]]
+  return QuadReadAcrossY(expr);
+}
+
+// CHECK-DXIL: declare [[TY]] @llvm.dx.quad.read.across.y.i32([[TY]]) 
#[[#attr:]]
+// CHECK-SPIRV: declare [[TY]] @llvm.spv.quad.read.across.y.i32([[TY]]) 
#[[#attr:]]
----------------
kcloudy0717 wrote:

That's a neat trick! I didn't know about this, thanks for letting me know. I 
updated the codegen tests for the intrinsic, it now uses the ICF capture (as 
well as CC capture for spir_func calling convention) and it should have tests 
for all supported types including 16bit tests as well for the intrinsic. Could 
you give it a read?

https://github.com/llvm/llvm-project/pull/187440
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to