[clang] [llvm] [HLSL][SPIRV][DXIL] Implement `WaveActiveSum` intrinsic (PR #118580)

Steven Perron via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 13 08:04:47 PST 2025


================
@@ -0,0 +1,41 @@
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32v1.3-vulkan-unknown %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32v1.3-vulkan-unknown %s -o - -filetype=obj | spirv-val %}
----------------
s-perron wrote:

Once you make that change, the test fails because the capabilities are not right. You will need to update this code:

https://github.com/llvm/llvm-project/blob/79e788d02eefdacb08af365389b9055518f3fad6/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp#L1355-L1357

You should only need `GroupNonUniformArithmetic` in this case. When the spec lists capabilities, it is an `or` between them. So only one of the capabilities is requires. In these case, you look at the opcode, and the group operation and pick the one common to both.

Once that is done, you will probably need to fixup more in the same file.

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


More information about the llvm-commits mailing list