MLIR  19.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:

Public Member Functions

 Builder (MLIRContext *context)
 
 Builder (Operation *op)
 
MLIRContextgetContext () const
 
Location getUnknownLoc ()
 
Location getFusedLoc (ArrayRef< Location > locs, Attribute metadata=Attribute())
 
FloatType getFloat8E5M2Type ()
 
FloatType getFloat8E4M3FNType ()
 
FloatType getFloat8E5M2FNUZType ()
 
FloatType getFloat8E4M3FNUZType ()
 
FloatType getFloat8E4M3B11FNUZType ()
 
FloatType getBF16Type ()
 
FloatType getF16Type ()
 
FloatType getTF32Type ()
 
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)
 
TypedAttr getZeroAttr (Type type)
 
TypedAttr getOneAttr (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)
 
DenseFPElementsAttr getF32VectorAttr (ArrayRef< float > values)
 
DenseFPElementsAttr getF64VectorAttr (ArrayRef< double > 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 50 of file Builders.h.

Constructor & Destructor Documentation

◆ Builder() [1/2]

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

Definition at line 52 of file Builders.h.

◆ Builder() [2/2]

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

Definition at line 53 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

◆ getBF16Type()

FloatType Builder::getBF16Type ( )

Definition at line 57 of file Builders.cpp.

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

Referenced by parseFloatType(), 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 132 of file Builders.cpp.

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

◆ 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 385 of file Builders.cpp.

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

Referenced by parseBound(), and resolveSourceIndicesCollapseShape().

◆ getContext()

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

Definition at line 55 of file Builders.h.

References context.

Referenced by addAtomicRMW(), addShardOp(), adjustMap(), allocateSubviewGPUMemoryInAddressSpace(), augmentMapAndBounds(), bitAndAddrspaceCast(), broadcastDynamicDimension(), mlir::tensor::bubbleUpPadSlice(), HopperBuilder::buildAndInitBarrierInSharedMemory(), HopperBuilder::buildBarrierArriveTx(), HopperBuilder::buildGlobalMemRefDescriptor(), buildLinearId(), buildLLVMFunctionType(), HopperBuilder::buildPredicateLoadsOnThread0(), HopperBuilder::buildTmaAsyncLoad(), calculateTileOffsetsAndSizes(), castAllocFuncResult(), castToElemPtrPtr(), mlir::affine::coalesceLoops(), common3DIdBuilderFn(), commonLinearIdBuilderFn(), computeIteratorTypesAndIndexingMaps(), mlir::linalg::computeSliceParameters(), mlir::memref::computeSuffixProductIRBlockImpl(), mlir::linalg::computeTileSizes(), constructTiledIndexSetHyperRect(), mlir::convertFuncOpToLLVMFuncOp(), convertFuncOpTypes(), convertIntrinsicResult(), createAsyncDispatchFunction(), createCtlzFunc(), createElementFPowIFunc(), createElementIPowIFunc(), createFullTiles(), mlir::LLVM::createGlobalString(), createGroupReduceOpImpl(), createI32ConstantOf(), mlir::tensor::createPadHighOp(), mlir::LLVM::createPrintStrCall(), createSubViewIntersection(), mlir::linalg::dropUnitDims(), emitElementwiseComputation(), mlir::tensor::ExtractSliceFromCollapseHelper::emitLoopNestBody(), mlir::impl::ensureRegionTerminator(), forEachIJPairInAllBuffers(), generatePointWiseCopy(), getBoundedTileSize(), getCleanupLoopLowerBound(), getCompressedMaskOp(), mlir::linalg::getConvolvedIndex(), mlir::affine::getDivMod(), getIndexArrayAttr(), getIndexingMapInExpandedOp(), getIndexProduct(), getIndicesForLoadOrStore(), getLaneId(), mlir::nvgpu::getLaneIdAndValueIdToOperandCoord(), mlir::nvgpu::getLaneIdToLdMatrixMatrixCoord(), mlir::memref::getLinearizedMemRefOffsetAndSize(), mlir::ConvertToLLVMPattern::getMemRefDescriptorSizes(), getOffsetForBitwidth(), mlir::sparse_tensor::getOpaquePointerType(), getScalarConstantAsAttr(), getSharedAddressSpaceAttribute(), mlir::ConvertToLLVMPattern::getSizeInBytes(), mlir::mesh::handlePartialAxesDuringResharding(), invertSliceIndexing(), linalgBroadcastAndMaybeExtSI(), mlir::affine::linearizeIndex(), mlir::linalg::lowerPack(), mlir::affine::makeComposedAffineApply(), mlir::affine::makeComposedFoldedAffineApply(), makeComposedFoldedMinMax(), mlir::linalg::makeMemRefCopyOp(), mlir::linalg::makeTransposeOp(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), mlir::GPUPrintfOpToLLVMCallLowering::matchAndRewrite(), mlir::GPUPrintfOpToVPrintfLowering::matchAndRewrite(), mlir::ComposeReassociativeReshapeOps< ReshapeOpTy, opKind >::matchAndRewrite(), DeduplicateAffineMinMaxExpressions< T >::matchAndRewrite(), MergeAffineMinMaxOp< T >::matchAndRewrite(), mlir::affine::AffineBuilder::max(), mlir::affine::mergeOffsetsSizesAndStrides(), mlir::affine::AffineBuilder::min(), mlir::x86vector::avx2::inline_asm::mm256BlendPsAsm(), mlir::mesh::moveLastSplitAxisInResharding(), movePaddingToFillOrGenericOp(), mlir::memref::multiBuffer(), mlir::linalg::offsetIndices(), mlir::outlineSingleBlockRegion(), mlir::linalg::packMatmulGreedily(), parseScheduleClause(), parseValuesWithVariadicity(), parseValueWithVariadicity(), peelForLoop(), mlir::LLVMTypeConverter::promoteOneMemRefDescriptor(), mlir::affine::resolveIndicesIntoOpWithOffsetsAndStrides(), resolveSourceIndicesExpandShape(), CopyBuilder::rewrite(), mlir::linalg::rewriteInIm2Col(), setInterTileBoundsParametric(), setIntraTileBoundsParametric(), mlir::UnrankedMemRefDescriptor::setSize(), mlir::UnrankedMemRefDescriptor::setStride(), mlir::UnrankedMemRefDescriptor::size(), mlir::MemRefDescriptor::size(), mlir::UnrankedMemRefDescriptor::sizeBasePtr(), sliceTransferIndices(), mlir::mesh::splitLastAxisInResharding(), mlir::UnrankedMemRefDescriptor::stride(), mlir::UnrankedMemRefDescriptor::strideBasePtr(), mlir::x86vector::avx2::transpose4x8xf32(), mlir::x86vector::avx2::transpose8x8xf32(), transposeOneLinalgOperandAndReplace(), mlir::mesh::unsplitLastAxisInResharding(), mlir::linalg::updateBoundsForCyclicDistribution(), updateExpandedGenericOpRegion(), and wrapExternalFunction().

◆ getDenseBoolArrayAttr()

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

Tensor-typed DenseArrayAttr getters.

Definition at line 167 of file Builders.cpp.

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

Referenced by mlir::parseDynamicIndexList().

◆ getDenseF32ArrayAttr()

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

Definition at line 187 of file Builders.cpp.

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

◆ getDenseF64ArrayAttr()

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

Definition at line 191 of file Builders.cpp.

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

◆ getDenseI16ArrayAttr()

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

Definition at line 175 of file Builders.cpp.

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

◆ getDenseI32ArrayAttr()

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

◆ getDenseI64ArrayAttr()

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

◆ getDenseI8ArrayAttr()

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

Definition at line 171 of file Builders.cpp.

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

◆ getDictionaryAttr()

DictionaryAttr Builder::getDictionaryAttr ( ArrayRef< NamedAttribute value)

◆ getDimIdentityMap()

AffineMap Builder::getDimIdentityMap ( )

◆ getEmptyAffineMap()

AffineMap Builder::getEmptyAffineMap ( )

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

Definition at line 383 of file Builders.cpp.

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

◆ getF128Type()

FloatType Builder::getF128Type ( )

Definition at line 69 of file Builders.cpp.

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

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

◆ getF16FloatAttr()

FloatAttr Builder::getF16FloatAttr ( float  value)

Definition at line 257 of file Builders.cpp.

References mlir::get(), and getF16Type().

◆ getF16Type()

FloatType Builder::getF16Type ( )

◆ getF32ArrayAttr()

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

Definition at line 301 of file Builders.cpp.

References getArrayAttr(), and getF32FloatAttr().

◆ getF32FloatAttr()

FloatAttr Builder::getF32FloatAttr ( float  value)

Definition at line 253 of file Builders.cpp.

References mlir::get(), and getF32Type().

Referenced by convertFloatAttr(), f32Cst(), genConstFloat32From(), and getF32ArrayAttr().

◆ getF32Type()

FloatType Builder::getF32Type ( )

◆ getF32VectorAttr()

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

Definition at line 156 of file Builders.cpp.

References mlir::DenseFPElementsAttr::get(), mlir::get(), and getF32Type().

◆ getF64ArrayAttr()

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

Definition at line 307 of file Builders.cpp.

References getArrayAttr(), and getF64FloatAttr().

◆ getF64FloatAttr()

FloatAttr Builder::getF64FloatAttr ( double  value)

Definition at line 249 of file Builders.cpp.

References mlir::get(), and getF64Type().

Referenced by getF64ArrayAttr().

◆ getF64Type()

FloatType Builder::getF64Type ( )

◆ getF64VectorAttr()

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

Definition at line 161 of file Builders.cpp.

References mlir::DenseFPElementsAttr::get(), mlir::get(), and getF64Type().

◆ getF80Type()

FloatType Builder::getF80Type ( )

Definition at line 67 of file Builders.cpp.

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

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

◆ getFloat8E4M3B11FNUZType()

FloatType Builder::getFloat8E4M3B11FNUZType ( )

◆ getFloat8E4M3FNType()

FloatType Builder::getFloat8E4M3FNType ( )

◆ getFloat8E4M3FNUZType()

FloatType Builder::getFloat8E4M3FNUZType ( )

◆ getFloat8E5M2FNUZType()

FloatType Builder::getFloat8E5M2FNUZType ( )

◆ getFloat8E5M2Type()

FloatType Builder::getFloat8E5M2Type ( )

◆ getFloatAttr() [1/2]

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

Definition at line 265 of file Builders.cpp.

References mlir::get().

◆ getFloatAttr() [2/2]

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

◆ getFunctionType()

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

◆ getFusedLoc()

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

Definition at line 29 of file Builders.cpp.

References context, and mlir::get().

◆ getI16IntegerAttr()

IntegerAttr Builder::getI16IntegerAttr ( int16_t  value)

Definition at line 230 of file Builders.cpp.

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

◆ getI16Type()

IntegerType Builder::getI16Type ( )

Definition at line 81 of file Builders.cpp.

References context, and mlir::get().

Referenced by mfmaConcatIfNeeded(), wmmaPushInputOperand(), and wmmaPushOutputOperand().

◆ getI1Type()

IntegerType Builder::getI1Type ( )

◆ getI2Type()

IntegerType Builder::getI2Type ( )

Definition at line 75 of file Builders.cpp.

References context, and mlir::get().

◆ getI32ArrayAttr()

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

Definition at line 283 of file Builders.cpp.

References getArrayAttr(), and getI32IntegerAttr().

Referenced by mlir::spirv::getDefaultResourceLimits().

◆ 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 195 of file Builders.cpp.

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

◆ getI32Type()

IntegerType Builder::getI32Type ( )

◆ getI32VectorAttr()

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

◆ getI4Type()

IntegerType Builder::getI4Type ( )

Definition at line 77 of file Builders.cpp.

References context, and mlir::get().

Referenced by rewriteI8ToI4Trunc().

◆ 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 202 of file Builders.cpp.

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

◆ getI64Type()

IntegerType Builder::getI64Type ( )

◆ getI64VectorAttr()

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

◆ getI8IntegerAttr()

IntegerAttr Builder::getI8IntegerAttr ( int8_t  value)

Definition at line 234 of file Builders.cpp.

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

◆ getI8Type()

IntegerType Builder::getI8Type ( )

◆ getIndexArrayAttr()

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

Definition at line 294 of file Builders.cpp.

References mlir::get(), getArrayAttr(), getContext(), and getIntegerAttr().

◆ getIndexAttr()

IntegerAttr Builder::getIndexAttr ( int64_t  value)

Definition at line 124 of file Builders.cpp.

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

Referenced by applyPad(), mlir::tensor::bubbleUpPadSlice(), mlir::arith::ConstantIndexOp::build(), mlir::bufferization::buildDeallocationLibraryFunction(), mlir::tensor::buildIndependentOp(), calculateTileOffsetsAndSizes(), mlir::linalg::computeSliceParameters(), mlir::memref::computeSuffixProductIRBlock(), computeTargetSize(), mlir::linalg::computeTileOffsets(), constifyIndexValues(), mlir::tensor::createCanonicalRankReducingExtractSliceOp(), mlir::tensor::createCanonicalRankReducingInsertSliceOp(), mlir::memref::createCanonicalRankReducingSubViewOp(), mlir::linalg::createFoldedDimOp(), createIndex(), createIndexAttrConstant(), mlir::tensor::createPadHighOp(), createSubViewIntersection(), expandValue(), fuse(), generateLoopNestUsingForallOp(), generateLoopNestUsingForOp(), getCollapsedOutputDimFromInputShape(), getDimValue(), getExpandedOutputDimFromInputShape(), getFlatOffsetAndStrides(), mlir::AllocationOpLLVMLowering::getIndexType(), mlir::memref::getLinearizedMemRefOffsetAndSize(), mlir::memref::getMixedSize(), mlir::tensor::getMixedSize(), mlir::sparse_tensor::getOneAttr(), getOneAttr(), mlir::tensor::getOrCreateDestination(), getOrFoldTensorDim(), getZeroAttr(), mlir::affine::linearizeIndex(), mlir::linalg::lowerPack(), mlir::linalg::lowerUnPack(), mlir::linalg::makeTiledLoopRanges(), mlir::GPUPrintfOpToVPrintfLowering::matchAndRewrite(), mlir::linalg::GeneralizeOuterUnitDimsPackOpPattern::matchAndRewrite(), mlir::linalg::GeneralizePadOpPattern::matchAndRewrite(), mlir::linalg::GeneralizeOuterUnitDimsUnPackOpPattern::matchAndRewrite(), mlir::affine::materializeComputedBound(), mlir::memref::multiBuffer(), mlir::linalg::packMatmulGreedily(), mlir::LLVMTypeConverter::promoteOneMemRefDescriptor(), mlir::linalg::promoteSubviewAsNewBuffer(), rankReducingSubviewDroppingUnitDims(), mlir::arith::reifyValueBound(), replaceByPackingResult(), mlir::affine::resolveIndicesIntoOpWithOffsetsAndStrides(), resolveSourceIndicesExpandShape(), mlir::linalg::rewriteAsPaddedOp(), mlir::linalg::rewriteInDestinationPassingStyle(), and mlir::linalg::unrollIndex().

◆ getIndexTensorAttr()

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

Definition at line 209 of file Builders.cpp.

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

◆ getIndexType()

IndexType Builder::getIndexType ( )

◆ getIndexVectorAttr()

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

Definition at line 150 of file Builders.cpp.

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

◆ getIntegerAttr() [1/2]

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

Definition at line 245 of file Builders.cpp.

References mlir::get().

◆ getIntegerAttr() [2/2]

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

◆ getIntegerType() [1/2]

IntegerType Builder::getIntegerType ( unsigned  width)

◆ getIntegerType() [2/2]

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

Definition at line 91 of file Builders.cpp.

References context, mlir::get(), and mlir::quant::QuantizationFlags::Signed.

◆ getMultiDimIdentityMap()

AffineMap Builder::getMultiDimIdentityMap ( unsigned  rank)

◆ getNamedAttr()

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

◆ getNoneType()

NoneType Builder::getNoneType ( )

Definition at line 104 of file Builders.cpp.

References context, and mlir::get().

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

◆ getOneAttr()

TypedAttr Builder::getOneAttr ( Type  type)

◆ 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 414 of file Builders.cpp.

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

◆ getSI32IntegerAttr()

IntegerAttr Builder::getSI32IntegerAttr ( int32_t  value)

Signed and unsigned integer attribute getters.

Definition at line 220 of file Builders.cpp.

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

◆ getSingleDimShiftAffineMap()

AffineMap Builder::getSingleDimShiftAffineMap ( int64_t  shift)

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

(d0) -> (d0 + shift)

Definition at line 408 of file Builders.cpp.

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

Referenced by constructTiledIndexSetHyperRect().

◆ getStrArrayAttr()

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

◆ getStringAttr()

StringAttr Builder::getStringAttr ( const Twine &  bytes)

◆ getSymbolIdentityMap()

AffineMap Builder::getSymbolIdentityMap ( )

Definition at line 403 of file Builders.cpp.

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

Referenced by parseBound().

◆ getTF32Type()

FloatType Builder::getTF32Type ( )

Definition at line 61 of file Builders.cpp.

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

Referenced by mlir::detail::Parser::parseNonFunctionType().

◆ getTupleType()

TupleType Builder::getTupleType ( TypeRange  elementTypes)

Definition at line 100 of file Builders.cpp.

References context, and mlir::get().

◆ getType()

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

Get or construct an instance of the type Ty with provided arguments.

Definition at line 93 of file Builders.h.

References context, and mlir::get().

Referenced by parseAsyncDependencies(), parseResultsValueType(), and mlir::mesh::reshardOn1DMesh().

◆ getTypeArrayAttr()

ArrayAttr Builder::getTypeArrayAttr ( TypeRange  values)

Definition at line 319 of file Builders.cpp.

References mlir::get(), and getArrayAttr().

◆ getUI32IntegerAttr()

IntegerAttr Builder::getUI32IntegerAttr ( uint32_t  value)

Definition at line 225 of file Builders.cpp.

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

◆ getUnitAttr()

UnitAttr Builder::getUnitAttr ( )

◆ getUnknownLoc()

Location Builder::getUnknownLoc ( )

◆ getZeroAttr()

TypedAttr Builder::getZeroAttr ( Type  type)

Member Data Documentation

◆ context

MLIRContext* mlir::Builder::context
protected

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