diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVEnums.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVEnums.cpp --- a/mlir/lib/Dialect/SPIRV/IR/SPIRVEnums.cpp +++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVEnums.cpp @@ -12,11 +12,8 @@ #include "mlir/Dialect/SPIRV/IR/SPIRVEnums.h" -#include "mlir/IR/BuiltinTypes.h" - #include "llvm/ADT/SetVector.h" #include "llvm/ADT/StringExtras.h" -#include "llvm/ADT/StringRef.h" #include @@ -54,25 +51,38 @@ Extension::SPV_KHR_physical_storage_buffer, \ Extension::SPV_KHR_vulkan_memory_model +// TODO(https://github.com/llvm/llvm-project/issues/59348): Implement +// missing 1.6 extensions (SPV_KHR_non_semantic_info, +// SPV_KHR_terminate_invocation). +#define V_1_6_IMPLIED_EXTS \ + Extension::SPV_EXT_demote_to_helper_invocation, \ + Extension::SPV_KHR_integer_dot_product + switch (version) { default: return {}; case Version::V_1_3: { // The following manual ArrayRef constructor call is to satisfy GCC 5. static const Extension exts[] = {V_1_3_IMPLIED_EXTS}; - return ArrayRef(exts, std::size(exts)); + return exts; } case Version::V_1_4: { static const Extension exts[] = {V_1_3_IMPLIED_EXTS, V_1_4_IMPLIED_EXTS}; - return ArrayRef(exts, std::size(exts)); + return exts; } case Version::V_1_5: { static const Extension exts[] = {V_1_3_IMPLIED_EXTS, V_1_4_IMPLIED_EXTS, V_1_5_IMPLIED_EXTS}; - return ArrayRef(exts, std::size(exts)); + return exts; + } + case Version::V_1_6: { + static const Extension exts[] = {V_1_3_IMPLIED_EXTS, V_1_4_IMPLIED_EXTS, + V_1_5_IMPLIED_EXTS, V_1_6_IMPLIED_EXTS}; + return exts; } } +#undef V_1_6_IMPLIED_EXTS #undef V_1_5_IMPLIED_EXTS #undef V_1_4_IMPLIED_EXTS #undef V_1_3_IMPLIED_EXTS