[clang] [llvm] [HLSL] Implement `WaveReadLaneAt` intrinsic for spirv backend (PR #111010)
Nathan Gauër via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 4 00:43:44 PDT 2024
================
@@ -0,0 +1,40 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -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 -x hlsl -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, uint idx) {
+ // CHECK-SPIRV: %[[#entry_tok:]] = call token @llvm.experimental.convergence.entry()
+
+ // CHECK-SPIRV: %[[RET:.*]] = call [[TY:.*]] @llvm.spv.wave.read.lane.at.i32([[TY]] %[[#]], i32 %[[#]])
----------------
Keenuts wrote:
Not sure if that's done on other wave intrinsics, but we might want to check that the `convergencectrl` attribute is attached to it.
https://github.com/llvm/llvm-project/pull/111010
More information about the cfe-commits
mailing list