
``` - add codegen for llvm builtin to spirv/directx intrinsic in CGBuiltin.cpp - add lowering of spirv intrinsic to spirv backend in SPIRVInstructionSelector.cpp - add lowering of directx intrinsic to dxil op in DXIL.td - add test cases to illustrate passes - add test case for semantic analysis ``` Resolves #80176
19 lines
716 B
HLSL
Executable File
19 lines
716 B
HLSL
Executable File
// 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 -DTARGET=dx
|
|
// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple \
|
|
// RUN: spirv-pc-vulkan-compute %s -emit-llvm -disable-llvm-passes -o - | \
|
|
// RUN: FileCheck %s -DTARGET=spv
|
|
|
|
// Test basic lowering to runtime function call.
|
|
|
|
// CHECK-LABEL: test_bool
|
|
int test_bool(bool expr) {
|
|
// CHECK: call {{.*}} @llvm.[[TARGET]].wave.active.countbits
|
|
return WaveActiveCountBits(expr);
|
|
}
|
|
|
|
// CHECK: declare i32 @llvm.[[TARGET]].wave.active.countbits(i1) #[[#attr:]]
|
|
|
|
// CHECK: attributes #[[#attr]] = {{{.*}} convergent {{.*}}}
|