llvm/mlir/lib/IR/Builders.cpp

//===- Builders.cpp - Helpers for constructing MLIR Classes ---------------===//
//
// 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 "mlir/IR/Builders.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/IR/IntegerSet.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/SymbolTable.h"
#include "llvm/ADT/SmallVectorExtras.h"
#include "llvm/Support/raw_ostream.h"

usingnamespacemlir;

//===----------------------------------------------------------------------===//
// Locations.
//===----------------------------------------------------------------------===//

Location Builder::getUnknownLoc() {}

Location Builder::getFusedLoc(ArrayRef<Location> locs, Attribute metadata) {}

//===----------------------------------------------------------------------===//
// Types.
//===----------------------------------------------------------------------===//

FloatType Builder::getFloat4E2M1FNType() {}

FloatType Builder::getFloat6E2M3FNType() {}

FloatType Builder::getFloat6E3M2FNType() {}

FloatType Builder::getFloat8E5M2Type() {}

FloatType Builder::getFloat8E4M3Type() {}

FloatType Builder::getFloat8E4M3FNType() {}

FloatType Builder::getFloat8E5M2FNUZType() {}

FloatType Builder::getFloat8E4M3FNUZType() {}

FloatType Builder::getFloat8E4M3B11FNUZType() {}

FloatType Builder::getFloat8E3M4Type() {}

FloatType Builder::getFloat8E8M0FNUType() {}

FloatType Builder::getBF16Type() {}

FloatType Builder::getF16Type() {}

FloatType Builder::getTF32Type() {}

FloatType Builder::getF32Type() {}

FloatType Builder::getF64Type() {}

FloatType Builder::getF80Type() {}

FloatType Builder::getF128Type() {}

IndexType Builder::getIndexType() {}

IntegerType Builder::getI1Type() {}

IntegerType Builder::getI2Type() {}

IntegerType Builder::getI4Type() {}

IntegerType Builder::getI8Type() {}

IntegerType Builder::getI16Type() {}

IntegerType Builder::getI32Type() {}

IntegerType Builder::getI64Type() {}

IntegerType Builder::getIntegerType(unsigned width) {}

IntegerType Builder::getIntegerType(unsigned width, bool isSigned) {}

FunctionType Builder::getFunctionType(TypeRange inputs, TypeRange results) {}

TupleType Builder::getTupleType(TypeRange elementTypes) {}

NoneType Builder::getNoneType() {}

//===----------------------------------------------------------------------===//
// Attributes.
//===----------------------------------------------------------------------===//

NamedAttribute Builder::getNamedAttr(StringRef name, Attribute val) {}

UnitAttr Builder::getUnitAttr() {}

BoolAttr Builder::getBoolAttr(bool value) {}

DictionaryAttr Builder::getDictionaryAttr(ArrayRef<NamedAttribute> value) {}

IntegerAttr Builder::getIndexAttr(int64_t value) {}

IntegerAttr Builder::getI64IntegerAttr(int64_t value) {}

DenseIntElementsAttr Builder::getBoolVectorAttr(ArrayRef<bool> values) {}

DenseIntElementsAttr Builder::getI32VectorAttr(ArrayRef<int32_t> values) {}

DenseIntElementsAttr Builder::getI64VectorAttr(ArrayRef<int64_t> values) {}

DenseIntElementsAttr Builder::getIndexVectorAttr(ArrayRef<int64_t> values) {}

DenseFPElementsAttr Builder::getF32VectorAttr(ArrayRef<float> values) {}

DenseFPElementsAttr Builder::getF64VectorAttr(ArrayRef<double> values) {}

DenseBoolArrayAttr Builder::getDenseBoolArrayAttr(ArrayRef<bool> values) {}

DenseI8ArrayAttr Builder::getDenseI8ArrayAttr(ArrayRef<int8_t> values) {}

DenseI16ArrayAttr Builder::getDenseI16ArrayAttr(ArrayRef<int16_t> values) {}

DenseI32ArrayAttr Builder::getDenseI32ArrayAttr(ArrayRef<int32_t> values) {}

DenseI64ArrayAttr Builder::getDenseI64ArrayAttr(ArrayRef<int64_t> values) {}

DenseF32ArrayAttr Builder::getDenseF32ArrayAttr(ArrayRef<float> values) {}

DenseF64ArrayAttr Builder::getDenseF64ArrayAttr(ArrayRef<double> values) {}

DenseIntElementsAttr Builder::getI32TensorAttr(ArrayRef<int32_t> values) {}

DenseIntElementsAttr Builder::getI64TensorAttr(ArrayRef<int64_t> values) {}

DenseIntElementsAttr Builder::getIndexTensorAttr(ArrayRef<int64_t> values) {}

IntegerAttr Builder::getI32IntegerAttr(int32_t value) {}

IntegerAttr Builder::getSI32IntegerAttr(int32_t value) {}

IntegerAttr Builder::getUI32IntegerAttr(uint32_t value) {}

IntegerAttr Builder::getI16IntegerAttr(int16_t value) {}

IntegerAttr Builder::getI8IntegerAttr(int8_t value) {}

IntegerAttr Builder::getIntegerAttr(Type type, int64_t value) {}

IntegerAttr Builder::getIntegerAttr(Type type, const APInt &value) {}

FloatAttr Builder::getF64FloatAttr(double value) {}

FloatAttr Builder::getF32FloatAttr(float value) {}

FloatAttr Builder::getF16FloatAttr(float value) {}

FloatAttr Builder::getFloatAttr(Type type, double value) {}

FloatAttr Builder::getFloatAttr(Type type, const APFloat &value) {}

StringAttr Builder::getStringAttr(const Twine &bytes) {}

ArrayAttr Builder::getArrayAttr(ArrayRef<Attribute> value) {}

ArrayAttr Builder::getBoolArrayAttr(ArrayRef<bool> values) {}

ArrayAttr Builder::getI32ArrayAttr(ArrayRef<int32_t> values) {}
ArrayAttr Builder::getI64ArrayAttr(ArrayRef<int64_t> values) {}

ArrayAttr Builder::getIndexArrayAttr(ArrayRef<int64_t> values) {}

ArrayAttr Builder::getF32ArrayAttr(ArrayRef<float> values) {}

ArrayAttr Builder::getF64ArrayAttr(ArrayRef<double> values) {}

ArrayAttr Builder::getStrArrayAttr(ArrayRef<StringRef> values) {}

ArrayAttr Builder::getTypeArrayAttr(TypeRange values) {}

ArrayAttr Builder::getAffineMapArrayAttr(ArrayRef<AffineMap> values) {}

TypedAttr Builder::getZeroAttr(Type type) {}

TypedAttr Builder::getOneAttr(Type type) {}

//===----------------------------------------------------------------------===//
// Affine Expressions, Affine Maps, and Integer Sets.
//===----------------------------------------------------------------------===//

AffineExpr Builder::getAffineDimExpr(unsigned position) {}

AffineExpr Builder::getAffineSymbolExpr(unsigned position) {}

AffineExpr Builder::getAffineConstantExpr(int64_t constant) {}

AffineMap Builder::getEmptyAffineMap() {}

AffineMap Builder::getConstantAffineMap(int64_t val) {}

AffineMap Builder::getDimIdentityMap() {}

AffineMap Builder::getMultiDimIdentityMap(unsigned rank) {}

AffineMap Builder::getSymbolIdentityMap() {}

AffineMap Builder::getSingleDimShiftAffineMap(int64_t shift) {}

AffineMap Builder::getShiftedAffineMap(AffineMap map, int64_t shift) {}

//===----------------------------------------------------------------------===//
// OpBuilder
//===----------------------------------------------------------------------===//

/// Insert the given operation at the current insertion point and return it.
Operation *OpBuilder::insert(Operation *op) {}

Block *OpBuilder::createBlock(Region *parent, Region::iterator insertPt,
                              TypeRange argTypes, ArrayRef<Location> locs) {}

/// Add new block with 'argTypes' arguments and set the insertion point to the
/// end of it.  The block is placed before 'insertBefore'.
Block *OpBuilder::createBlock(Block *insertBefore, TypeRange argTypes,
                              ArrayRef<Location> locs) {}

/// Create an operation given the fields represented as an OperationState.
Operation *OpBuilder::create(const OperationState &state) {}

/// Creates an operation with the given fields.
Operation *OpBuilder::create(Location loc, StringAttr opName,
                             ValueRange operands, TypeRange types,
                             ArrayRef<NamedAttribute> attributes,
                             BlockRange successors,
                             MutableArrayRef<std::unique_ptr<Region>> regions) {}

LogicalResult OpBuilder::tryFold(Operation *op,
                                 SmallVectorImpl<Value> &results) {}

/// Helper function that sends block insertion notifications for every block
/// that is directly nested in the given op.
static void notifyBlockInsertions(Operation *op,
                                  OpBuilder::Listener *listener) {}

Operation *OpBuilder::clone(Operation &op, IRMapping &mapper) {}

Operation *OpBuilder::clone(Operation &op) {}

void OpBuilder::cloneRegionBefore(Region &region, Region &parent,
                                  Region::iterator before, IRMapping &mapping) {}

void OpBuilder::cloneRegionBefore(Region &region, Region &parent,
                                  Region::iterator before) {}

void OpBuilder::cloneRegionBefore(Region &region, Block *before) {}