llvm/llvm/utils/TableGen/Common/InfoByHwMode.h

//===--- InfoByHwMode.h -----------------------------------------*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
// Classes that implement data parameterized by HW modes for instruction
// selection. Currently it is ValueTypeByHwMode (parameterized ValueType),
// and RegSizeInfoByHwMode (parameterized register/spill size and alignment
// data).
//===----------------------------------------------------------------------===//

#ifndef LLVM_UTILS_TABLEGEN_COMMON_INFOBYHWMODE_H
#define LLVM_UTILS_TABLEGEN_COMMON_INFOBYHWMODE_H

#include "CodeGenHwModes.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGenTypes/MachineValueType.h"
#include "llvm/Support/Compiler.h"
#include <cassert>
#include <limits>
#include <map>
#include <string>
#include <tuple>
#include <utility>

namespace llvm {

class Record;
class raw_ostream;

template <typename InfoT> struct InfoByHwMode;

std::string getModeName(unsigned Mode);

enum : unsigned {};

template <typename InfoT>
void union_modes(const InfoByHwMode<InfoT> &A, const InfoByHwMode<InfoT> &B,
                 SmallVectorImpl<unsigned> &Modes) {}

template <typename InfoT> struct InfoByHwMode {};

struct ValueTypeByHwMode : public InfoByHwMode<MVT> {};

ValueTypeByHwMode getValueTypeByHwMode(Record *Rec, const CodeGenHwModes &CGH);

raw_ostream &operator<<(raw_ostream &OS, const ValueTypeByHwMode &T);

struct RegSizeInfo {};

struct RegSizeInfoByHwMode : public InfoByHwMode<RegSizeInfo> {};

raw_ostream &operator<<(raw_ostream &OS, const RegSizeInfo &T);
raw_ostream &operator<<(raw_ostream &OS, const RegSizeInfoByHwMode &T);

struct SubRegRange {};

struct SubRegRangeByHwMode : public InfoByHwMode<SubRegRange> {};

struct EncodingInfoByHwMode : public InfoByHwMode<Record *> {};

} // namespace llvm

#endif // LLVM_UTILS_TABLEGEN_COMMON_INFOBYHWMODE_H