llvm/mlir/lib/Bytecode/Writer/IRNumbering.cpp

//===- IRNumbering.cpp - MLIR Bytecode IR numbering -----------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#include "IRNumbering.h"
#include "mlir/Bytecode/BytecodeImplementation.h"
#include "mlir/Bytecode/BytecodeOpInterface.h"
#include "mlir/Bytecode/BytecodeWriter.h"
#include "mlir/Bytecode/Encoding.h"
#include "mlir/IR/AsmState.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/OpDefinition.h"

usingnamespacemlir;
usingnamespacemlir::bytecode::detail;

//===----------------------------------------------------------------------===//
// NumberingDialectWriter
//===----------------------------------------------------------------------===//

struct IRNumberingState::NumberingDialectWriter : public DialectBytecodeWriter {};

//===----------------------------------------------------------------------===//
// IR Numbering
//===----------------------------------------------------------------------===//

/// Group and sort the elements of the given range by their parent dialect. This
/// grouping is applied to sub-sections of the ranged defined by how many bytes
/// it takes to encode a varint index to that sub-section.
template <typename T>
static void groupByDialectPerByte(T range) {}

IRNumberingState::IRNumberingState(Operation *op,
                                   const BytecodeWriterConfig &config)
    :{}

void IRNumberingState::computeGlobalNumberingState(Operation *rootOp) {}

void IRNumberingState::number(Attribute attr) {}

void IRNumberingState::number(Block &block) {}

auto IRNumberingState::numberDialect(Dialect *dialect) -> DialectNumbering & {}

auto IRNumberingState::numberDialect(StringRef dialect) -> DialectNumbering & {}

void IRNumberingState::number(Region &region) {}

void IRNumberingState::number(Operation &op) {}

void IRNumberingState::number(OperationName opName) {}

void IRNumberingState::number(Type type) {}

void IRNumberingState::number(Dialect *dialect,
                              ArrayRef<AsmDialectResourceHandle> resources) {}

int64_t IRNumberingState::getDesiredBytecodeVersion() const {}

namespace {
/// A dummy resource builder used to number dialect resources.
struct NumberingResourceBuilder : public AsmResourceBuilder {};
} // namespace

void IRNumberingState::finalizeDialectResourceNumberings(Operation *rootOp) {}