LLVM 24.0.0git
SPIRVMachineFunctionInfo.h
Go to the documentation of this file.
1//===-- SPIRVMachineFunctionInfo.h - SPIR-V machine function info -*- 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// MIR serialization of the SPIR-V type assigned to each virtual register.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_SPIRV_SPIRVMACHINEFUNCTIONINFO_H
14#define LLVM_LIB_TARGET_SPIRV_SPIRVMACHINEFUNCTIONINFO_H
15
17
18namespace llvm {
19class MachineFunction;
20
21namespace yaml {
22
27
28template <> struct MappingTraits<SPIRVVRegType> {
29 static void mapping(IO &YamlIO, SPIRVVRegType &VRegType) {
30 YamlIO.mapRequired("reg", VRegType.Reg);
31 YamlIO.mapRequired("type", VRegType.Type);
32 }
33
34 static const bool flow = true;
35};
36
37} // end namespace yaml
38} // end namespace llvm
39
41
42namespace llvm {
43namespace yaml {
44
46 std::vector<SPIRVVRegType> VRegTypes;
47
50
51 void mappingImpl(yaml::IO &YamlIO) override;
52};
53
55 static void mapping(IO &YamlIO, SPIRVMachineFunctionInfo &MFI) {
56 YamlIO.mapOptional("vregTypes", MFI.VRegTypes);
57 }
58};
59
60} // end namespace yaml
61} // end namespace llvm
62
63#endif // LLVM_LIB_TARGET_SPIRV_SPIRVMACHINEFUNCTIONINFO_H
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
Utility for declaring that a std::vector of a particular type should be considered a YAML sequence.
void mapOptional(StringRef Key, T &Val)
Definition YAMLTraits.h:800
void mapRequired(StringRef Key, T &Val)
Definition YAMLTraits.h:790
This is an optimization pass for GlobalISel generic memory operations.
Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.
static void mapping(IO &YamlIO, SPIRVMachineFunctionInfo &MFI)
static void mapping(IO &YamlIO, SPIRVVRegType &VRegType)
This class should be specialized by any type that needs to be converted to/from a YAML mapping.
Definition YAMLTraits.h:63
void mappingImpl(yaml::IO &YamlIO) override
A wrapper around std::string which contains a source range that's being set during parsing.