Debian Codegraph @

clang/test/CodeGenHLSL/builtins/WaveActiveCountBits.hlsl

raw
1 // RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple \
2 // RUN: dxil-pc-shadermodel6.3-compute %s -emit-llvm -disable-llvm-passes -o - | \
3 // RUN: FileCheck %s -DTARGET=dx
4 // RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple \
5 // RUN: spirv-pc-vulkan-compute %s -emit-llvm -disable-llvm-passes -o - | \
6 // RUN: FileCheck %s -DTARGET=spv
7
8 // Test basic lowering to runtime function call.
9
10 // CHECK-LABEL: test_bool
11 int test_bool(bool expr) {
12 // CHECK: call {{.*}} @llvm.[[TARGET]].wave.active.countbits
13 return WaveActiveCountBits(expr);
14 }
15
16 // CHECK: declare i32 @llvm.[[TARGET]].wave.active.countbits(i1) #[[#attr:]]
17
18 // CHECK: attributes #[[#attr]] = {{{.*}} convergent {{.*}}}