//===- SPIRVBinaryUtils.cpp - MLIR SPIR-V Binary Module Utilities ---------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines common utilities for SPIR-V binary module. // //===----------------------------------------------------------------------===// #include "mlir/Target/SPIRV/SPIRVBinaryUtils.h" #include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h" #include "llvm/Config/llvm-config.h" // for LLVM_VERSION_MAJOR usingnamespacemlir; void spirv::appendModuleHeader(SmallVectorImpl<uint32_t> &header, spirv::Version version, uint32_t idBound) { … } /// Returns the word-count-prefixed opcode for an SPIR-V instruction. uint32_t spirv::getPrefixedOpcode(uint32_t wordCount, spirv::Opcode opcode) { … } void spirv::encodeStringLiteralInto(SmallVectorImpl<uint32_t> &binary, StringRef literal) { … }