================ @@ -0,0 +1,95 @@ +; RUN: llc -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s +; Note: The validator is wrong it wants the return to be a bool vector when it is bool scalar return ---------------- Keenuts wrote:
AFAIK the validator is not wrong, it complains for 2 reasons: `OpAll` cannot be used with a single boolean as input: It **must** be a vector of boolean. And SPIR-V doesn't allow vector of 1 value. Hence, `all(my_bool)` shall be translated to `return my_bool`. Then, for int/long intrinsics: HLSL only checks if the value (any type) is non-zero for all vector items. for SPIR-V, `OpAll` only works for boolean vectors. This means the translation is not that straightforward. What is being done in DXC is the following: ``` %const = OpConstantComposite %v2int %int_0 %int_0 %tmp = OpINotEqual %v2bool %variable %const %res = OpAll %bool %tmp ``` https://github.com/llvm/llvm-project/pull/87171 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits