MLIR 23.0.0git
SPIRVExtInstSets.h
Go to the documentation of this file.
1//===- SPIRVExtInstSets.h - SPIR-V ext inst sets ----------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares extended instruction set constants used by SPIR-V
10// (de)serialization.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MLIR_TARGET_SPIRV_SPIRVEXTINSTSETS_H
15#define MLIR_TARGET_SPIRV_SPIRVEXTINSTSETS_H
16
17#include "llvm/ADT/STLExtras.h"
18#include "llvm/ADT/StringRef.h"
19#include <cstdint>
20
21namespace mlir::spirv {
22
23/// Extension set name for TOSA ops.
24constexpr llvm::StringLiteral extTosa{"TOSA.001000.1"};
25
26/// Extension set name for non-semantic graph debug info.
27constexpr llvm::StringLiteral extDebugInfo{"NonSemantic.Graph.DebugInfo.1"};
28
29/// Instruction opcodes in the NonSemantic.Graph.DebugInfo.1 extended
30/// instruction set.
31enum class GraphDebugInfoExtInst : uint32_t {
35};
36
37constexpr bool isValidGraphDebugInfoExtInst(uint32_t opcode) {
38 return llvm::is_contained(
39 {
40 llvm::to_underlying(GraphDebugInfoExtInst::DebugGraph),
41 llvm::to_underlying(GraphDebugInfoExtInst::DebugOperation),
42 llvm::to_underlying(GraphDebugInfoExtInst::DebugTensor),
43 },
44 opcode);
45}
46
47} // namespace mlir::spirv
48
49#endif // MLIR_TARGET_SPIRV_SPIRVEXTINSTSETS_H
constexpr llvm::StringLiteral extDebugInfo
Extension set name for non-semantic graph debug info.
constexpr bool isValidGraphDebugInfoExtInst(uint32_t opcode)
constexpr llvm::StringLiteral extTosa
Extension set name for TOSA ops.
GraphDebugInfoExtInst
Instruction opcodes in the NonSemantic.Graph.DebugInfo.1 extended instruction set.