MLIR  16.0.0git
Public Member Functions | Protected Attributes | List of all members
mlir::Builder Class Reference

This class is a general helper class for creating context-global objects like types, attributes, and affine expressions. More...

#include "mlir/IR/Builders.h"

+ Inheritance diagram for mlir::Builder:
+ Collaboration diagram for mlir::Builder:

Public Member Functions

 Builder (MLIRContext *context)
 
 Builder (Operation *op)
 
MLIRContextgetContext () const
 
Location getUnknownLoc ()
 
Location getFusedLoc (ArrayRef< Location > locs, Attribute metadata=Attribute())
 
FloatType getFloat8E5M2Type ()
 
FloatType getBF16Type ()
 
FloatType getF16Type ()
 
FloatType getF32Type ()
 
FloatType getF64Type ()
 
FloatType getF80Type ()
 
FloatType getF128Type ()
 
IndexType getIndexType ()
 
IntegerType getI1Type ()
 
IntegerType getI2Type ()
 
IntegerType getI4Type ()
 
IntegerType getI8Type ()
 
IntegerType getI16Type ()
 
IntegerType getI32Type ()
 
IntegerType getI64Type ()
 
IntegerType getIntegerType (unsigned width)
 
IntegerType getIntegerType (unsigned width, bool isSigned)
 
FunctionType getFunctionType (TypeRange inputs, TypeRange results)
 
TupleType getTupleType (TypeRange elementTypes)
 
NoneType getNoneType ()
 
template<typename Ty , typename... Args>
Ty getType (Args &&...args)
 Get or construct an instance of the type Ty with provided arguments. More...
 
template<typename Attr , typename... Args>
Attr getAttr (Args &&...args)
 Get or construct an instance of the attribute Attr with provided arguments. More...
 
NamedAttribute getNamedAttr (StringRef name, Attribute val)
 
UnitAttr getUnitAttr ()
 
BoolAttr getBoolAttr (bool value)
 
DictionaryAttr getDictionaryAttr (ArrayRef< NamedAttribute > value)
 
IntegerAttr getIntegerAttr (Type type, int64_t value)
 
IntegerAttr getIntegerAttr (Type type, const APInt &value)
 
FloatAttr getFloatAttr (Type type, double value)
 
FloatAttr getFloatAttr (Type type, const APFloat &value)
 
StringAttr getStringAttr (const Twine &bytes)
 
ArrayAttr getArrayAttr (ArrayRef< Attribute > value)
 
Attribute getZeroAttr (Type type)
 
FloatAttr getF16FloatAttr (float value)
 
FloatAttr getF32FloatAttr (float value)
 
FloatAttr getF64FloatAttr (double value)
 
IntegerAttr getI8IntegerAttr (int8_t value)
 
IntegerAttr getI16IntegerAttr (int16_t value)
 
IntegerAttr getI32IntegerAttr (int32_t value)
 
IntegerAttr getI64IntegerAttr (int64_t value)
 
IntegerAttr getIndexAttr (int64_t value)
 
IntegerAttr getSI32IntegerAttr (int32_t value)
 Signed and unsigned integer attribute getters. More...
 
IntegerAttr getUI32IntegerAttr (uint32_t value)
 
DenseIntElementsAttr getBoolVectorAttr (ArrayRef< bool > values)
 Vector-typed DenseIntElementsAttr getters. values must not be empty. More...
 
DenseIntElementsAttr getI32VectorAttr (ArrayRef< int32_t > values)
 
DenseIntElementsAttr getI64VectorAttr (ArrayRef< int64_t > values)
 
DenseIntElementsAttr getIndexVectorAttr (ArrayRef< int64_t > values)
 
DenseIntElementsAttr getI32TensorAttr (ArrayRef< int32_t > values)
 Tensor-typed DenseIntElementsAttr getters. More...
 
DenseIntElementsAttr getI64TensorAttr (ArrayRef< int64_t > values)
 
DenseIntElementsAttr getIndexTensorAttr (ArrayRef< int64_t > values)
 
DenseBoolArrayAttr getDenseBoolArrayAttr (ArrayRef< bool > values)
 Tensor-typed DenseArrayAttr getters. More...
 
DenseI8ArrayAttr getDenseI8ArrayAttr (ArrayRef< int8_t > values)
 
DenseI16ArrayAttr getDenseI16ArrayAttr (ArrayRef< int16_t > values)
 
DenseI32ArrayAttr getDenseI32ArrayAttr (ArrayRef< int32_t > values)
 
DenseI64ArrayAttr getDenseI64ArrayAttr (ArrayRef< int64_t > values)
 
DenseF32ArrayAttr getDenseF32ArrayAttr (ArrayRef< float > values)
 
DenseF64ArrayAttr getDenseF64ArrayAttr (ArrayRef< double > values)
 
ArrayAttr getAffineMapArrayAttr (ArrayRef< AffineMap > values)
 
ArrayAttr getBoolArrayAttr (ArrayRef< bool > values)
 
ArrayAttr getI32ArrayAttr (ArrayRef< int32_t > values)
 
ArrayAttr getI64ArrayAttr (ArrayRef< int64_t > values)
 
ArrayAttr getIndexArrayAttr (ArrayRef< int64_t > values)
 
ArrayAttr getF32ArrayAttr (ArrayRef< float > values)
 
ArrayAttr getF64ArrayAttr (ArrayRef< double > values)
 
ArrayAttr getStrArrayAttr (ArrayRef< StringRef > values)
 
ArrayAttr getTypeArrayAttr (TypeRange values)
 
AffineExpr getAffineDimExpr (unsigned position)
 
AffineExpr getAffineSymbolExpr (unsigned position)
 
AffineExpr getAffineConstantExpr (int64_t constant)
 
AffineMap getEmptyAffineMap ()
 Returns a zero result affine map with no dimensions or symbols: () -> (). More...
 
AffineMap getConstantAffineMap (int64_t val)
 Returns a single constant result affine map with 0 dimensions and 0 symbols. More...
 
AffineMap getDimIdentityMap ()
 
AffineMap getMultiDimIdentityMap (unsigned rank)
 
AffineMap getSymbolIdentityMap ()
 
AffineMap getSingleDimShiftAffineMap (int64_t shift)
 Returns a map that shifts its (single) input dimension by 'shift'. More...
 
AffineMap getShiftedAffineMap (AffineMap map, int64_t shift)
 Returns an affine map that is a translation (shift) of all result expressions in 'map' by 'shift'. More...
 

Protected Attributes

MLIRContextcontext
 

Detailed Description

This class is a general helper class for creating context-global objects like types, attributes, and affine expressions.

Definition at line 49 of file Builders.h.

Constructor & Destructor Documentation

◆ Builder() [1/2]

mlir::Builder::Builder ( MLIRContext context)
inlineexplicit

Definition at line 51 of file Builders.h.

◆ Builder() [2/2]

mlir::Builder::Builder ( Operation op)
inlineexplicit

Definition at line 52 of file Builders.h.

Member Function Documentation

◆ getAffineConstantExpr()

AffineExpr Builder::getAffineConstantExpr ( int64_t  constant)

◆ getAffineDimExpr()

AffineExpr Builder::getAffineDimExpr ( unsigned  position)

◆ getAffineMapArrayAttr()

ArrayAttr Builder::getAffineMapArrayAttr ( ArrayRef< AffineMap values)

◆ getAffineSymbolExpr()

AffineExpr Builder::getAffineSymbolExpr ( unsigned  position)

◆ getArrayAttr()

ArrayAttr Builder::getArrayAttr ( ArrayRef< Attribute value)

◆ getAttr()

template<typename Attr , typename... Args>
Attr mlir::Builder::getAttr ( Args &&...  args)
inline

Get or construct an instance of the attribute Attr with provided arguments.

Definition at line 94 of file Builders.h.

References context, getAffineConstantExpr(), getAffineDimExpr(), getAffineMapArrayAttr(), getAffineSymbolExpr(), getArrayAttr(), getBoolArrayAttr(), getBoolAttr(), getBoolVectorAttr(), getConstantAffineMap(), getDenseBoolArrayAttr(), getDenseF32ArrayAttr(), getDenseF64ArrayAttr(), getDenseI16ArrayAttr(), getDenseI32ArrayAttr(), getDenseI64ArrayAttr(), getDenseI8ArrayAttr(), getDictionaryAttr(), getDimIdentityMap(), getEmptyAffineMap(), getF16FloatAttr(), getF32ArrayAttr(), getF32FloatAttr(), getF64ArrayAttr(), getF64FloatAttr(), getFloatAttr(), getI16IntegerAttr(), getI32ArrayAttr(), getI32IntegerAttr(), getI32TensorAttr(), getI32VectorAttr(), getI64ArrayAttr(), getI64IntegerAttr(), getI64TensorAttr(), getI64VectorAttr(), getI8IntegerAttr(), getIndexArrayAttr(), getIndexAttr(), getIndexTensorAttr(), getIndexVectorAttr(), getIntegerAttr(), getMultiDimIdentityMap(), getNamedAttr(), getShiftedAffineMap(), getSI32IntegerAttr(), getSingleDimShiftAffineMap(), getStrArrayAttr(), getStringAttr(), getSymbolIdentityMap(), getTypeArrayAttr(), getUI32IntegerAttr(), getUnitAttr(), getZeroAttr(), and value.

Referenced by mlir::tosa::buildConvOpQuantizationAttr(), mlir::tosa::buildMatMulOpQuantizationAttr(), mlir::tosa::buildPadOpQuantizationAttr(), mlir::tosa::buildUnaryOpQuantizationAttr(), mlir::spirv::Deserializer::collect(), getDefaultABIAttrs(), getInsertExtractValueElementType(), hasOneBranchOpTo(), isIntegerPtxType(), mlir::gpu::mapParallelOp(), parseControlAttribute(), parseEnumKeywordAttr(), parseEnumStrAttr(), verifyConstantType(), and verifyGroupNonUniformShuffleOp().

◆ getBF16Type()

FloatType Builder::getBF16Type ( )

Definition at line 40 of file Builders.cpp.

References context, and mlir::FloatType::getBF16().

Referenced by getContext(), and mlir::detail::Parser::parseNonFunctionType().

◆ getBoolArrayAttr()

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

◆ getBoolAttr()

BoolAttr Builder::getBoolAttr ( bool  value)

◆ getBoolVectorAttr()

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

Vector-typed DenseIntElementsAttr getters. values must not be empty.

Definition at line 113 of file Builders.cpp.

References mlir::DenseIntElementsAttr::get(), and getI1Type().

Referenced by getAttr().

◆ getConstantAffineMap()

AffineMap Builder::getConstantAffineMap ( int64_t  val)

Returns a single constant result affine map with 0 dimensions and 0 symbols.

One constant result: () -> (val).

Definition at line 337 of file Builders.cpp.

References mlir::AffineMap::get(), and getAffineConstantExpr().

Referenced by getAttr(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), mlir::normalizeAffineFor(), and resolveSourceIndicesCollapseShape().

◆ getContext()

MLIRContext* mlir::Builder::getContext ( ) const
inline

Definition at line 54 of file Builders.h.

References context, getBF16Type(), getF128Type(), getF16Type(), getF32Type(), getF64Type(), getF80Type(), getFloat8E5M2Type(), getFunctionType(), getFusedLoc(), getI16Type(), getI1Type(), getI2Type(), getI32Type(), getI4Type(), getI64Type(), getI8Type(), getIndexType(), getIntegerType(), getNoneType(), getTupleType(), and getUnknownLoc().

Referenced by addResumeFunction(), adjustMap(), augmentMapAndBounds(), mlir::tensor::bubbleUpPadSlice(), buildLLVMFunctionType(), mlir::scf::buildLoopNest(), calculateExpandedAccessIndices(), calculateImplicitMap(), canonicalizeMinMaxOp(), mlir::coalesceLoops(), mlir::linalg::computeSliceParameters(), computeTensorReshapeCollapsedType(), mlir::linalg::computeTileSizes(), mlir::TypeConverter::convertBlockSignature(), convertIntrinsicResult(), convertStructType(), copy(), mlir::ConvertToLLVMPattern::copyUnrankedDescriptors(), createAsyncDispatchFunction(), createDepthwiseConvCollapseMap(), createElementIPowIFunc(), createFullTiles(), mlir::LLVM::createGlobalString(), createI32Constant(), createI32ConstantOf(), createLinalgBodyCalculationForElementwiseOp(), mlir::tensor::createPadHighOp(), createReassociationMapsForCollapse(), declareReduction(), elementwiseMatchAndRewriteHelper(), mlir::tensor::ExtractSliceFromCollapseHelper::emitLoopNestBody(), encodeKernelName(), mlir::impl::ensureRegionTerminator(), findAncestorOpInRegion(), mlir::AffineDmaWaitOp::fold(), foldMemRefCast(), generateCopy(), generatePointWiseCopy(), generateTileLoopNest(), genFor(), genVectorMask(), getCleanupLoopLowerBound(), getDefaultABIAttrs(), mlir::scf::getForeachThreadOpThreadIndexOwner(), getIndexArrayAttr(), getIndexingMapInExpandedOp(), getIndexProduct(), mlir::nvgpu::getLaneIdAndValueIdToOperandCoord(), mlir::nvgpu::getLaneIdToLdMatrixMatrixCoord(), getLibraryCallSymbolRef(), getLoadStoreElementType(), HoistingAnalysis::getPackedTensorSizes(), inlinePayload(), invertSliceIndexing(), isIntegerPtxType(), mlir::linalg::makeMemRefCopyOp(), mlir::linalg::makeTransposeOp(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::GPUIndexIntrinsicOpLowering< Op, XOp, YOp, ZOp >::matchAndRewrite(), mlir::OpToFuncCallLowering< SourceOp >::matchAndRewrite(), TransferWritePermutationLowering::matchAndRewrite(), mlir::ComposeReassociativeReshapeOps< ReshapeOpTy >::matchAndRewrite(), mlir::vector::ContractionOpToMatmulOpLowering::matchAndRewrite(), mlir::linalg::PadOpTransformationPattern::matchAndRewrite(), DeduplicateAffineMinMaxExpressions< T >::matchAndRewrite(), MergeAffineMinMaxOp< T >::matchAndRewrite(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), materializeConstants(), mlir::mergeOffsetsSizesAndStrides(), mlir::x86vector::avx2::inline_asm::mm256BlendPsAsm(), mlir::normalizeAffineFor(), mlir::normalizeMemRefType(), mlir::linalg::offsetIndices(), mlir::outlineSingleBlockRegion(), parentLLVMModule(), parseLoopControl(), parseScheduleClause(), peelForLoop(), prependResAttrsToArgAttrs(), printShuffleType(), reduceMatchAndRewriteHelper(), replaceUnitDimIndexOps(), replaceUnitExtents(), setInterTileBoundsParametric(), setIntraTileBoundsParametric(), sliceTransferIndices(), splatZero(), mlir::linalg::splitOp(), tileLinalgOpImpl(), tilePadOp(), mlir::scf::tileParallelLoop(), tileToForeachThreadOpImpl(), mlir::linalg::tileToForeachThreadOpUsingTileSizes(), mlir::x86vector::avx2::transpose4x8xf32(), mlir::x86vector::avx2::transpose8x8xf32(), mlir::DataDescriptor::undef(), unpackOperandVector(), mlir::linalg::updateBoundsForCyclicDistribution(), updateExpandedGenericOpRegion(), verifyConstantType(), wrapAsStructAttrs(), and wrapExternalFunction().

◆ getDenseBoolArrayAttr()

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

Tensor-typed DenseArrayAttr getters.

Definition at line 137 of file Builders.cpp.

References context, and mlir::detail::DenseArrayAttrImpl< T >::get().

Referenced by getAttr().

◆ getDenseF32ArrayAttr()

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

Definition at line 157 of file Builders.cpp.

References context, and mlir::detail::DenseArrayAttrImpl< T >::get().

Referenced by getAttr().

◆ getDenseF64ArrayAttr()

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

Definition at line 161 of file Builders.cpp.

References context, and mlir::detail::DenseArrayAttrImpl< T >::get().

Referenced by getAttr().

◆ getDenseI16ArrayAttr()

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

Definition at line 145 of file Builders.cpp.

References context, and mlir::detail::DenseArrayAttrImpl< T >::get().

Referenced by getAttr().

◆ getDenseI32ArrayAttr()

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

◆ getDenseI64ArrayAttr()

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

Definition at line 153 of file Builders.cpp.

References context, and mlir::detail::DenseArrayAttrImpl< T >::get().

Referenced by getAttr().

◆ getDenseI8ArrayAttr()

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

Definition at line 141 of file Builders.cpp.

References context, and mlir::detail::DenseArrayAttrImpl< T >::get().

Referenced by getAttr().

◆ getDictionaryAttr()

DictionaryAttr Builder::getDictionaryAttr ( ArrayRef< NamedAttribute value)

Definition at line 101 of file Builders.cpp.

References context.

Referenced by mlir::function_interface_impl::addArgAndResultAttrs(), and getAttr().

◆ getDimIdentityMap()

AffineMap Builder::getDimIdentityMap ( )

◆ getEmptyAffineMap()

AffineMap Builder::getEmptyAffineMap ( )

Returns a zero result affine map with no dimensions or symbols: () -> ().

Definition at line 335 of file Builders.cpp.

References context, and mlir::AffineMap::get().

Referenced by composeSetAndOperands(), getAttr(), verifyMemoryOpIndexing(), and verifyVectorMemoryOp().

◆ getF128Type()

FloatType Builder::getF128Type ( )

Definition at line 50 of file Builders.cpp.

References context, and mlir::FloatType::getF128().

Referenced by getContext(), and mlir::detail::Parser::parseNonFunctionType().

◆ getF16FloatAttr()

FloatAttr Builder::getF16FloatAttr ( float  value)

Definition at line 227 of file Builders.cpp.

References getF16Type().

Referenced by getAttr().

◆ getF16Type()

FloatType Builder::getF16Type ( )

◆ getF32ArrayAttr()

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

Definition at line 272 of file Builders.cpp.

References getArrayAttr(), and getF32FloatAttr().

Referenced by getAttr().

◆ getF32FloatAttr()

FloatAttr Builder::getF32FloatAttr ( float  value)

◆ getF32Type()

FloatType Builder::getF32Type ( )

◆ getF64ArrayAttr()

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

Definition at line 278 of file Builders.cpp.

References getArrayAttr(), and getF64FloatAttr().

Referenced by getAttr().

◆ getF64FloatAttr()

FloatAttr Builder::getF64FloatAttr ( double  value)

Definition at line 219 of file Builders.cpp.

References getF64Type().

Referenced by getAttr(), and getF64ArrayAttr().

◆ getF64Type()

FloatType Builder::getF64Type ( )

◆ getF80Type()

FloatType Builder::getF80Type ( )

Definition at line 48 of file Builders.cpp.

References context, and mlir::FloatType::getF80().

Referenced by getContext(), and mlir::detail::Parser::parseNonFunctionType().

◆ getFloat8E5M2Type()

FloatType Builder::getFloat8E5M2Type ( )

◆ getFloatAttr() [1/2]

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

◆ getFloatAttr() [2/2]

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

Definition at line 235 of file Builders.cpp.

◆ getFunctionType()

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

◆ getFusedLoc()

Location Builder::getFusedLoc ( ArrayRef< Location locs,
Attribute  metadata = Attribute() 
)

Definition at line 28 of file Builders.cpp.

References context.

Referenced by collapseGenericOpIterationDims(), executeGetOperandsResults(), and getContext().

◆ getI16IntegerAttr()

IntegerAttr Builder::getI16IntegerAttr ( int16_t  value)

Definition at line 200 of file Builders.cpp.

References getIntegerType().

Referenced by getAttr(), and verifyResultTypesAreInferrable().

◆ getI16Type()

IntegerType Builder::getI16Type ( )

Definition at line 62 of file Builders.cpp.

References context.

Referenced by getContext().

◆ getI1Type()

IntegerType Builder::getI1Type ( )

◆ getI2Type()

IntegerType Builder::getI2Type ( )

Definition at line 56 of file Builders.cpp.

References context.

Referenced by getContext().

◆ getI32ArrayAttr()

ArrayAttr Builder::getI32ArrayAttr ( ArrayRef< int32_t >  values)

◆ getI32IntegerAttr()

IntegerAttr Builder::getI32IntegerAttr ( int32_t  value)

◆ getI32TensorAttr()

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

Tensor-typed DenseIntElementsAttr getters.

values can be empty. These are generally preferable for representing general lists of integers as attributes.

Definition at line 165 of file Builders.cpp.

References mlir::DenseIntElementsAttr::get(), and getIntegerType().

Referenced by getAttr(), and CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite().

◆ getI32Type()

IntegerType Builder::getI32Type ( )

◆ getI32VectorAttr()

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

◆ getI4Type()

IntegerType Builder::getI4Type ( )

Definition at line 58 of file Builders.cpp.

References context.

Referenced by getContext().

◆ getI64ArrayAttr()

ArrayAttr Builder::getI64ArrayAttr ( ArrayRef< int64_t >  values)

◆ getI64IntegerAttr()

IntegerAttr Builder::getI64IntegerAttr ( int64_t  value)

◆ getI64TensorAttr()

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

Definition at line 172 of file Builders.cpp.

References mlir::DenseIntElementsAttr::get(), and getIntegerType().

Referenced by getAttr().

◆ getI64Type()

IntegerType Builder::getI64Type ( )

◆ getI64VectorAttr()

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

◆ getI8IntegerAttr()

IntegerAttr Builder::getI8IntegerAttr ( int8_t  value)

◆ getI8Type()

IntegerType Builder::getI8Type ( )

◆ getIndexArrayAttr()

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

Definition at line 264 of file Builders.cpp.

References getArrayAttr(), getContext(), and getIntegerAttr().

Referenced by getAttr().

◆ getIndexAttr()

IntegerAttr Builder::getIndexAttr ( int64_t  value)

◆ getIndexTensorAttr()

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

Definition at line 179 of file Builders.cpp.

References mlir::DenseIntElementsAttr::get(), and getIndexType().

Referenced by eachHasOnlyOneOfTypes(), and getAttr().

◆ getIndexType()

IndexType Builder::getIndexType ( )

Definition at line 52 of file Builders.cpp.

References context.

Referenced by mlir::gpu::addAsyncDependency(), addResumeFunction(), mlir::arith::ConstantIndexOp::build(), mlir::scf::buildLoopNest(), composeSetAndOperands(), computeMemRefRankReductionMask(), convertTransferWriteToStores(), createAsyncDispatchFunction(), createForAllDimensions(), createNewDynamicSizes(), createNonLdMatrixLoads(), mlir::tensor::createPadScalarOp(), createReassociationMapsForCollapse(), doSequentialDispatch(), eachHasOnlyOneOfTypes(), extractOne(), mlir::AffineDmaWaitOp::fold(), foldTransferInBoundsAttribute(), generateGpuBlockIds(), genIf(), genIndexLoad(), genLoad(), genWhile(), getContext(), getIndexAttr(), getIndexTensorAttr(), getIndexVectorAttr(), mlir::sparse_tensor::getOverheadType(), getParallelComputeFunctionType(), insertCopyLoops(), insertOne(), mlir::scf::insideMutuallyExclusiveBranches(), mlir::makeComposedAffineMin(), AllocaScopeHoister::matchAndRewrite(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), materializeConstants(), outlineExecuteOp(), mlir::AffineDmaStartOp::parse(), mlir::AffineDmaWaitOp::parse(), parseAffineMinMaxOp(), parseBound(), mlir::parseDimAndSymbolList(), parseGlobalMemrefOpTypeAndInitialValue(), mlir::detail::Parser::parseNonFunctionType(), parseSizeAssignment(), mlir::bufferization::populateDynamicDimSizes(), printInitializationList(), printTransferAttrs(), reifyConstantDim(), rewriteOneForeachThreadToGpuThreads(), mlir::vector::splitFullAndPartialTransfer(), mlir::scf::tileParallelLoop(), vectorizeLinalgIndex(), verifyDimAndSymbolIdentifiers(), verifyGatherOrScatterDims(), verifyMemoryOpIndexing(), verifyNumBlockArgs(), verifyVectorMemoryOp(), and wrapExternalFunction().

◆ getIndexVectorAttr()

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

Definition at line 131 of file Builders.cpp.

References mlir::DenseIntElementsAttr::get(), and getIndexType().

Referenced by getAttr(), and vectorizeLinalgIndex().

◆ getIntegerAttr() [1/2]

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

◆ getIntegerAttr() [2/2]

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

Definition at line 215 of file Builders.cpp.

◆ getIntegerType() [1/2]

IntegerType Builder::getIntegerType ( unsigned  width)

Definition at line 68 of file Builders.cpp.

References context.

Referenced by addResumeFunction(), adjustAccessChainForBitwidth(), mlir::bufferization::allocateTensorForShapedValue(), allocBuffer(), broadcast(), mlir::arith::ConstantIntOp::build(), mlir::tosa::buildConvOpResultTypeInfo(), buildMatMulOpWithQuantInfo(), convertStructType(), createI32Constant(), createLinalgBodyCalculationForElementwiseOp(), createReassociationMapsForCollapse(), declareReduction(), frexp(), getContext(), getI16IntegerAttr(), getI32IntegerAttr(), getI32TensorAttr(), getI32VectorAttr(), getI64IntegerAttr(), getI64TensorAttr(), getI64VectorAttr(), getI8IntegerAttr(), getOffsetForBitwidth(), mlir::sparse_tensor::getOverheadType(), getScalarOrVectorI32Constant(), getSI32IntegerAttr(), getUI32IntegerAttr(), getUnaryOpResultType(), mlir::vector::getVectorSubscriptType(), hasOneBranchOpTo(), mlir::scf::insideMutuallyExclusiveBranches(), mlir::GPUPrintfOpToLLVMCallLowering::matchAndRewrite(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), mfmaConcatIfNeeded(), mlir::detail::Parser::parseDecOrHexAttr(), parseGlobalMemrefOpTypeAndInitialValue(), parseGroupNonUniformArithmeticOp(), parseMemoryAccessAttributes(), parseSourceMemoryAccessAttributes(), mlir::detail::Parser::parseSparseElementsAttr(), parseStorageType(), parseVariableDecorations(), shiftValue(), mlir::linalg::splitReductionByScaling(), mlir::scf::tileParallelLoop(), unpackOperandVector(), verifyAtomicCompareExchangeImpl(), and verifyPointerAndCoopMatrixType().

◆ getIntegerType() [2/2]

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

Definition at line 72 of file Builders.cpp.

References context, and mlir::quant::QuantizationFlags::Signed.

◆ getMultiDimIdentityMap()

AffineMap Builder::getMultiDimIdentityMap ( unsigned  rank)

◆ getNamedAttr()

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

◆ getNoneType()

NoneType Builder::getNoneType ( )

◆ getShiftedAffineMap()

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

Returns an affine map that is a translation (shift) of all result expressions in 'map' by 'shift'.

Eg: input: (d0, d1)[s0] -> (d0, d1 + s0), shift = 2 returns: (d0, d1)[s0] -> (d0 + 2, d1 + s0 + 2)

Definition at line 366 of file Builders.cpp.

References context, mlir::AffineMap::get(), mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumResults(), mlir::AffineMap::getNumSymbols(), mlir::AffineMap::getResults(), and mlir::OpBuilder::Listener::~Listener().

Referenced by getAttr().

◆ getSI32IntegerAttr()

IntegerAttr Builder::getSI32IntegerAttr ( int32_t  value)

Signed and unsigned integer attribute getters.

Definition at line 190 of file Builders.cpp.

References getIntegerType().

Referenced by getAttr().

◆ getSingleDimShiftAffineMap()

AffineMap Builder::getSingleDimShiftAffineMap ( int64_t  shift)

Returns a map that shifts its (single) input dimension by 'shift'.

(d0) -> (d0 + shift)

Definition at line 360 of file Builders.cpp.

References mlir::AffineMap::get(), and getAffineDimExpr().

Referenced by getAttr().

◆ getStrArrayAttr()

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

◆ getStringAttr()

StringAttr Builder::getStringAttr ( const Twine &  bytes)

◆ getSymbolIdentityMap()

AffineMap Builder::getSymbolIdentityMap ( )

Definition at line 355 of file Builders.cpp.

References mlir::AffineMap::get(), and getAffineSymbolExpr().

Referenced by getAttr().

◆ getTupleType()

TupleType Builder::getTupleType ( TypeRange  elementTypes)

Definition at line 81 of file Builders.cpp.

References context.

Referenced by getContext().

◆ getType()

template<typename Ty , typename... Args>
Ty mlir::Builder::getType ( Args &&...  args)
inline

◆ getTypeArrayAttr()

ArrayAttr Builder::getTypeArrayAttr ( TypeRange  values)

Definition at line 290 of file Builders.cpp.

References getArrayAttr().

Referenced by getAttr().

◆ getUI32IntegerAttr()

IntegerAttr Builder::getUI32IntegerAttr ( uint32_t  value)

Definition at line 195 of file Builders.cpp.

References getIntegerType().

Referenced by getAttr().

◆ getUnitAttr()

UnitAttr Builder::getUnitAttr ( )

◆ getUnknownLoc()

Location Builder::getUnknownLoc ( )

◆ getZeroAttr()

Attribute Builder::getZeroAttr ( Type  type)

Member Data Documentation

◆ context

MLIRContext* mlir::Builder::context
protected

The documentation for this class was generated from the following files: