MLIR 24.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 extGraphDebugInfo{
28 "NonSemantic.Graph.DebugInfo.1"};
29
30/// Instruction opcodes in the NonSemantic.Graph.DebugInfo.1 extended
31/// instruction set.
32enum class GraphDebugInfoExtInst : uint32_t {
36};
37
38constexpr bool isValidGraphDebugInfoExtInst(uint32_t opcode) {
39 return llvm::is_contained(
40 {
41 llvm::to_underlying(GraphDebugInfoExtInst::DebugGraph),
42 llvm::to_underlying(GraphDebugInfoExtInst::DebugOperation),
43 llvm::to_underlying(GraphDebugInfoExtInst::DebugTensor),
44 },
45 opcode);
46}
47
48} // namespace mlir::spirv
49
50#endif // MLIR_TARGET_SPIRV_SPIRVEXTINSTSETS_H
constexpr bool isValidGraphDebugInfoExtInst(uint32_t opcode)
constexpr llvm::StringLiteral extGraphDebugInfo
Extension set name for non-semantic graph debug info.
constexpr llvm::StringLiteral extTosa
Extension set name for TOSA ops.
GraphDebugInfoExtInst
Instruction opcodes in the NonSemantic.Graph.DebugInfo.1 extended instruction set.