MLIR
18.0.0git
|
This class is a general helper class for creating context-global objects like types, attributes, and affine expressions. More...
#include "mlir/IR/Builders.h"
Public Member Functions | |
Builder (MLIRContext *context) | |
Builder (Operation *op) | |
MLIRContext * | getContext () 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) |
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 | |
MLIRContext * | context |
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.
|
inlineexplicit |
Definition at line 52 of file Builders.h.
|
inlineexplicit |
Definition at line 53 of file Builders.h.
AffineExpr Builder::getAffineConstantExpr | ( | int64_t | constant | ) |
Definition at line 361 of file Builders.cpp.
References context, and mlir::getAffineConstantExpr().
Referenced by mlir::scf::addLoopRangeConstraints(), broadcastDynamicDimension(), mlir::ValueBoundsConstraintSet::computeBound(), createInBoundsCond(), createPrivateMemRef(), emitElementwiseComputation(), mlir::foldAttributesIntoMap(), getConstantAffineMap(), mlir::ValueBoundsConstraintSet::getExpr(), mlir::memref::getLinearizedMemRefOffsetAndSize(), isTransposeMatrixLoadMap(), mlir::linalg::rewriteInIm2Col(), setInterTileBoundsParametric(), and setIntraTileBoundsParametric().
AffineExpr Builder::getAffineDimExpr | ( | unsigned | position | ) |
Definition at line 353 of file Builders.cpp.
References context, and mlir::getAffineDimExpr().
Referenced by mlir::alignAffineMapWithValues(), augmentMapAndBounds(), broadcastDynamicDimension(), mlir::tensor::buildIndependentOp(), mlir::vector::castAwayContractionLeadingOneDim(), mlir::affine::coalesceLoops(), mlir::ValueBoundsConstraintSet::computeBound(), mlir::ValueBoundsConstraintSet::computeConstantBound(), mlir::ValueBoundsConstraintSet::computeConstantDelta(), constructTiledIndexSetHyperRect(), createDepthwiseConvCollapseMap(), createInBoundsCond(), createPrivateMemRef(), createReassociationMapsForCollapse(), doubleBuffer(), emitElementwiseComputation(), mlir::foldAttributesIntoMap(), forEachIJPairInAllBuffers(), mlir::affine::fullyComposeAndComputeConstantDelta(), generatePointWiseCopy(), getCleanupLoopLowerBound(), getDimIdentityMap(), mlir::ValueBoundsConstraintSet::getExpr(), getMultiDimIdentityMap(), getSingleDimShiftAffineMap(), getXferIndices(), isTransposeMatrixLoadMap(), mlir::affine::loopUnrollJamByFactor(), packLinalgMetadataOnce(), processParallelLoop(), resolveSourceIndicesCollapseShape(), mlir::linalg::rewriteInIm2Col(), and setIntraTileBoundsParametric().
Definition at line 325 of file Builders.cpp.
References mlir::get(), and getArrayAttr().
Referenced by mlir::vector::castAwayContractionLeadingOneDim(), mlir::linalg::fuseElementwiseOps(), and mlir::linalg::interchangeGenericOp().
AffineExpr Builder::getAffineSymbolExpr | ( | unsigned | position | ) |
Definition at line 357 of file Builders.cpp.
References context, and mlir::getAffineSymbolExpr().
Referenced by mlir::scf::addLoopRangeConstraints(), mlir::alignAffineMapWithValues(), mlir::ValueBoundsConstraintSet::areEqual(), mlir::ValueBoundsConstraintSet::areOverlappingSlices(), mlir::affine::coalesceLoops(), mlir::ValueBoundsConstraintSet::computeBound(), mlir::foldAttributesIntoMap(), getCollapsedOutputDimFromInputShape(), getExpandedOutputDimFromInputShape(), mlir::ValueBoundsConstraintSet::getExpr(), getFlatOffsetAndStrides(), getSymbolIdentityMap(), processParallelLoop(), setInterTileBoundsParametric(), and setIntraTileBoundsParametric().
Definition at line 273 of file Builders.cpp.
References context, and mlir::get().
Referenced by mlir::function_interface_impl::addArgAndResultAttrs(), mlir::vector::castAwayContractionLeadingOneDim(), mlir::sparse_tensor::constantOne(), mlir::sparse_tensor::constantZero(), mlir::convertFuncOpToLLVMFuncOp(), getAffineMapArrayAttr(), getBoolArrayAttr(), getF32ArrayAttr(), getF64ArrayAttr(), getI32ArrayAttr(), getI64ArrayAttr(), getIndexArrayAttr(), mlir::getReassociationIndicesAttribute(), getStrArrayAttr(), getTypeArrayAttr(), mlir::linalg::interchangeGenericOp(), mlir::detail::Parser::parseAttribute(), parseAttributesOp(), parseAttributions(), parseCreateOperationOpAttributes(), parseForeachMatchSymbols(), parseOperationOpAttributes(), and parseVerCapExtAttr().
|
inline |
Get or construct an instance of the attribute Attr
with provided arguments.
Definition at line 100 of file Builders.h.
References context, and mlir::get().
Referenced by mlir::tosa::buildConvOpQuantizationAttr(), mlir::tosa::buildMatMulOpQuantizationAttr(), mlir::tosa::buildPadOpQuantizationAttr(), mlir::tosa::buildUnaryOpQuantizationAttr(), mlir::gpu::mapParallelOp(), parseOffloadingHandler(), and mlir::LLVM::detail::LoopAnnotationImporter::translateAccessGroup().
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().
ArrayAttr Builder::getBoolArrayAttr | ( | ArrayRef< bool > | values | ) |
Definition at line 277 of file Builders.cpp.
References getArrayAttr(), and getBoolAttr().
Referenced by inverseTransposeInBoundsAttr(), PadOpVectorizationWithTransferReadPattern::rewriteUser(), PadOpVectorizationWithTransferWritePattern::rewriteUser(), and mlir::vector::splitFullAndPartialTransfer().
BoolAttr Builder::getBoolAttr | ( | bool | value | ) |
Definition at line 116 of file Builders.cpp.
References context, and mlir::BoolAttr::get().
Referenced by buildBoolValue(), mlir::bufferization::buildDeallocationLibraryFunction(), convertBoolAttr(), getBoolArrayAttr(), hoistAffineIfOp(), and mlir::detail::Parser::parseAttribute().
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().
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 367 of file Builders.cpp.
References mlir::AffineMap::get(), and getAffineConstantExpr().
Referenced by parseBound(), and resolveSourceIndicesCollapseShape().
|
inline |
Definition at line 55 of file Builders.h.
References context.
Referenced by addAtomicRMW(), 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::linalg::computeTileSizes(), constructTiledIndexSetHyperRect(), mlir::convertFuncOpToLLVMFuncOp(), convertFuncOpTypes(), convertIntrinsicResult(), createAsyncDispatchFunction(), createCtlzFunc(), createElementFPowIFunc(), createElementIPowIFunc(), createFullTiles(), mlir::LLVM::createGlobalString(), createGroupReduceOpImpl(), createI32ConstantOf(), mlir::tensor::createPadHighOp(), mlir::LLVM::createPrintStrCall(), mlir::linalg::dropUnitDims(), emitElementwiseComputation(), mlir::tensor::ExtractSliceFromCollapseHelper::emitLoopNestBody(), mlir::impl::ensureRegionTerminator(), forEachIJPairInAllBuffers(), generatePointWiseCopy(), getBoundedTileSize(), getCleanupLoopLowerBound(), 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(), invertSliceIndexing(), mlir::linalg::lowerPack(), 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 >::matchAndRewrite(), DeduplicateAffineMinMaxExpressions< T >::matchAndRewrite(), MergeAffineMinMaxOp< T >::matchAndRewrite(), mlir::affine::AffineBuilder::max(), mlir::affine::mergeOffsetsSizesAndStrides(), mlir::affine::AffineBuilder::min(), mlir::x86vector::avx2::inline_asm::mm256BlendPsAsm(), movePaddingToFillOrGenericOp(), mlir::memref::multiBuffer(), mlir::linalg::offsetIndices(), mlir::outlineSingleBlockRegion(), mlir::linalg::packMatmulGreedily(), parseGangClause(), parseLoopControl(), parseRoutineGangClause(), parseScheduleClause(), parseValuesWithVariadicity(), parseValueWithVariadicity(), parseVectorClause(), parseWorkerClause(), 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::UnrankedMemRefDescriptor::stride(), mlir::UnrankedMemRefDescriptor::strideBasePtr(), mlir::x86vector::avx2::transpose4x8xf32(), mlir::x86vector::avx2::transpose8x8xf32(), transposeOneLinalgOperandAndReplace(), mlir::linalg::updateBoundsForCyclicDistribution(), updateExpandedGenericOpRegion(), and wrapExternalFunction().
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().
DenseF32ArrayAttr Builder::getDenseF32ArrayAttr | ( | ArrayRef< float > | values | ) |
Definition at line 187 of file Builders.cpp.
References context, and mlir::detail::DenseArrayAttrImpl< T >::get().
DenseF64ArrayAttr Builder::getDenseF64ArrayAttr | ( | ArrayRef< double > | values | ) |
Definition at line 191 of file Builders.cpp.
References context, and mlir::detail::DenseArrayAttrImpl< T >::get().
DenseI16ArrayAttr Builder::getDenseI16ArrayAttr | ( | ArrayRef< int16_t > | values | ) |
Definition at line 175 of file Builders.cpp.
References context, and mlir::detail::DenseArrayAttrImpl< T >::get().
DenseI32ArrayAttr Builder::getDenseI32ArrayAttr | ( | ArrayRef< int32_t > | values | ) |
Definition at line 179 of file Builders.cpp.
References context, and mlir::detail::DenseArrayAttrImpl< int32_t >::get().
Referenced by parseCommonStructuredOpParts().
DenseI64ArrayAttr Builder::getDenseI64ArrayAttr | ( | ArrayRef< int64_t > | values | ) |
Definition at line 183 of file Builders.cpp.
References context, and mlir::detail::DenseArrayAttrImpl< T >::get().
Referenced by mlir::tosa::EqualizeRanks(), ConcatSliceOptimization::matchAndRewrite(), mlir::parseDynamicIndexList(), mlir::transform::parsePackedOrDynamicIndexList(), parseStructuredTransformDims(), and parseSwitchCases().
DenseI8ArrayAttr Builder::getDenseI8ArrayAttr | ( | ArrayRef< int8_t > | values | ) |
Definition at line 171 of file Builders.cpp.
References context, and mlir::detail::DenseArrayAttrImpl< T >::get().
DictionaryAttr Builder::getDictionaryAttr | ( | ArrayRef< NamedAttribute > | value | ) |
Definition at line 120 of file Builders.cpp.
References context, and mlir::get().
Referenced by mlir::function_interface_impl::addArgAndResultAttrs(), handleArgumentImpl(), handleResultImpl(), parseAttributions(), and propagateArgResAttrs().
AffineMap Builder::getDimIdentityMap | ( | ) |
Definition at line 372 of file Builders.cpp.
References mlir::AffineMap::get(), and getAffineDimExpr().
Referenced by buildAffineLoopFromValues(), constructTiledIndexSetHyperRect(), mlir::gpu::mapParallelOp(), and mlir::affine::promoteIfSingleIteration().
AffineMap Builder::getEmptyAffineMap | ( | ) |
Returns a zero result affine map with no dimensions or symbols: () -> ().
Definition at line 365 of file Builders.cpp.
References context, and mlir::AffineMap::get().
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().
FloatAttr Builder::getF16FloatAttr | ( | float | value | ) |
Definition at line 257 of file Builders.cpp.
References mlir::get(), and getF16Type().
FloatType Builder::getF16Type | ( | ) |
Definition at line 59 of file Builders.cpp.
References context, and mlir::FloatType::getF16().
Referenced by convertIntrinsicResult(), getF16FloatAttr(), parseFloatType(), and mlir::detail::Parser::parseNonFunctionType().
ArrayAttr Builder::getF32ArrayAttr | ( | ArrayRef< float > | values | ) |
Definition at line 301 of file Builders.cpp.
References getArrayAttr(), and 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().
FloatType Builder::getF32Type | ( | ) |
Definition at line 63 of file Builders.cpp.
References context, and mlir::FloatType::getF32().
Referenced by castToF32(), convertIntrinsicResult(), exp2I32(), f32FromBits(), frexp(), genConstFloat32From(), getF32FloatAttr(), getF32VectorAttr(), parseFloatType(), mlir::detail::Parser::parseNonFunctionType(), and unpackOperandVector().
DenseFPElementsAttr Builder::getF32VectorAttr | ( | ArrayRef< float > | values | ) |
Definition at line 156 of file Builders.cpp.
References mlir::DenseFPElementsAttr::get(), mlir::get(), and getF32Type().
ArrayAttr Builder::getF64ArrayAttr | ( | ArrayRef< double > | values | ) |
Definition at line 307 of file Builders.cpp.
References getArrayAttr(), and getF64FloatAttr().
FloatAttr Builder::getF64FloatAttr | ( | double | value | ) |
Definition at line 249 of file Builders.cpp.
References mlir::get(), and getF64Type().
Referenced by getF64ArrayAttr().
FloatType Builder::getF64Type | ( | ) |
Definition at line 65 of file Builders.cpp.
References context, and mlir::FloatType::getF64().
Referenced by convertIntrinsicResult(), getF64FloatAttr(), getF64VectorAttr(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), mlir::GPUPrintfOpToVPrintfLowering::matchAndRewrite(), mlir::detail::Parser::parseFloatAttr(), parseFloatType(), mlir::detail::Parser::parseNonFunctionType(), and unpackOperandVector().
DenseFPElementsAttr Builder::getF64VectorAttr | ( | ArrayRef< double > | values | ) |
Definition at line 161 of file Builders.cpp.
References mlir::DenseFPElementsAttr::get(), mlir::get(), and getF64Type().
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().
FloatType Builder::getFloat8E4M3B11FNUZType | ( | ) |
Definition at line 53 of file Builders.cpp.
References context, and mlir::FloatType::getFloat8E4M3B11FNUZ().
Referenced by mlir::detail::Parser::parseNonFunctionType().
FloatType Builder::getFloat8E4M3FNType | ( | ) |
Definition at line 41 of file Builders.cpp.
References context, and mlir::FloatType::getFloat8E4M3FN().
Referenced by parseFloatType(), and mlir::detail::Parser::parseNonFunctionType().
FloatType Builder::getFloat8E4M3FNUZType | ( | ) |
Definition at line 49 of file Builders.cpp.
References context, and mlir::FloatType::getFloat8E4M3FNUZ().
Referenced by parseFloatType(), and mlir::detail::Parser::parseNonFunctionType().
FloatType Builder::getFloat8E5M2FNUZType | ( | ) |
Definition at line 45 of file Builders.cpp.
References context, and mlir::FloatType::getFloat8E5M2FNUZ().
Referenced by parseFloatType(), and mlir::detail::Parser::parseNonFunctionType().
FloatType Builder::getFloat8E5M2Type | ( | ) |
Definition at line 37 of file Builders.cpp.
References context, and mlir::FloatType::getFloat8E5M2().
Referenced by parseFloatType(), and mlir::detail::Parser::parseNonFunctionType().
FloatAttr Builder::getFloatAttr | ( | Type | type, |
const APFloat & | value | ||
) |
Definition at line 265 of file Builders.cpp.
References mlir::get().
FloatAttr Builder::getFloatAttr | ( | Type | type, |
double | value | ||
) |
Definition at line 261 of file Builders.cpp.
References mlir::get().
Referenced by mlir::arith::ConstantFloatOp::build(), createElementFPowIFunc(), createFloatConst(), createFPConstant(), declareReduction(), floatCst(), mlir::sparse_tensor::getOneAttr(), getScalarConstantAsAttr(), and getZeroAttr().
Definition at line 96 of file Builders.cpp.
References context, and mlir::get().
Referenced by mlir::bufferization::buildDeallocationLibraryFunction(), createAsyncDispatchFunction(), lowerAsEntryFunction(), and mlir::detail::Parser::parseFunctionType().
Definition at line 29 of file Builders.cpp.
References context, and mlir::get().
IntegerAttr Builder::getI16IntegerAttr | ( | int16_t | value | ) |
Definition at line 230 of file Builders.cpp.
References mlir::get(), and getIntegerType().
IntegerType Builder::getI16Type | ( | ) |
Definition at line 81 of file Builders.cpp.
References context, and mlir::get().
Referenced by mfmaConcatIfNeeded(), wmmaPushInputOperand(), and wmmaPushOutputOperand().
IntegerType Builder::getI1Type | ( | ) |
Definition at line 73 of file Builders.cpp.
References context, and mlir::get().
Referenced by mlir::bufferization::buildDeallocationLibraryFunction(), createI1Constant(), mlir::ControlFlowToSCFTransformation::createStructuredDoWhileLoopOp(), genSparseReducedAffineCond(), getBoolVectorAttr(), and vectorizeAsTensorPadOp().
IntegerType Builder::getI2Type | ( | ) |
Definition at line 75 of file Builders.cpp.
References context, and mlir::get().
ArrayAttr Builder::getI32ArrayAttr | ( | ArrayRef< int32_t > | values | ) |
Definition at line 283 of file Builders.cpp.
References getArrayAttr(), and getI32IntegerAttr().
Referenced by mlir::spirv::getDefaultResourceLimits().
IntegerAttr Builder::getI32IntegerAttr | ( | int32_t | value | ) |
Definition at line 216 of file Builders.cpp.
References mlir::get(), and getIntegerType().
Referenced by broadcast(), convertIntrinsicResult(), mlir::ControlFlowToSCFTransformation::getCFGSwitchValue(), getI32ArrayAttr(), getScalarOrVectorI32Constant(), i32Cst(), parseInterfaceVarABIAttr(), parseVerCapExtAttr(), and splitVectorStore().
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().
IntegerType Builder::getI32Type | ( | ) |
Definition at line 83 of file Builders.cpp.
References context, and mlir::get().
Referenced by mlir::tosa::buildConvOpResultTypeInfo(), buildMatMulOpWithQuantInfo(), mlir::arm_sme::castTileIDToI32(), convertIntrinsicResult(), createI32Constant(), createI32ConstantOf(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), mlir::GPUPrintfOpToLLVMCallLowering::matchAndRewrite(), mlir::GPUPrintfOpToVPrintfLowering::matchAndRewrite(), ConvertLoad::matchAndRewrite(), ConsolidateTransposeOptimization::matchAndRewrite(), truncToI32(), unpackOperandVector(), and wmmaPushInputOperand().
DenseIntElementsAttr Builder::getI32VectorAttr | ( | ArrayRef< int32_t > | values | ) |
Definition at line 138 of file Builders.cpp.
References mlir::DenseIntElementsAttr::get(), mlir::get(), and getIntegerType().
Referenced by getScalarOrVectorI32Constant().
IntegerType Builder::getI4Type | ( | ) |
Definition at line 77 of file Builders.cpp.
References context, and mlir::get().
ArrayAttr Builder::getI64ArrayAttr | ( | ArrayRef< int64_t > | values | ) |
Definition at line 288 of file Builders.cpp.
References getArrayAttr(), and getI64IntegerAttr().
Referenced by mlir::decomposeMixedValues(), mlir::getReassociationIndicesAttribute(), and mlir::vector::getVectorSubscriptAttr().
IntegerAttr Builder::getI64IntegerAttr | ( | int64_t | value | ) |
Definition at line 128 of file Builders.cpp.
References mlir::get(), and getIntegerType().
Referenced by mlir::bufferization::allocateTensorForShapedValue(), allocBuffer(), mlir::bufferization::BufferizationOptions::createAlloc(), getI64ArrayAttr(), mlir::getMixedValues(), handleByValArgumentInit(), parseCmpOp(), reifyConstantDim(), mlir::vector::splitFullAndPartialTransfer(), and unpackOperandVector().
DenseIntElementsAttr Builder::getI64TensorAttr | ( | ArrayRef< int64_t > | values | ) |
Definition at line 202 of file Builders.cpp.
References mlir::DenseIntElementsAttr::get(), mlir::get(), and getIntegerType().
IntegerType Builder::getI64Type | ( | ) |
Definition at line 85 of file Builders.cpp.
References context, and mlir::get().
Referenced by createTruncatedFPValue(), mlir::sparse_tensor::genIndexLoad(), handleByValArgumentInit(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), mlir::GPUPrintfOpToVPrintfLowering::matchAndRewrite(), parseSynchronizationHint(), mlir::LLVMTypeConverter::promoteOneMemRefDescriptor(), and unpackOperandVector().
DenseIntElementsAttr Builder::getI64VectorAttr | ( | ArrayRef< int64_t > | values | ) |
Definition at line 144 of file Builders.cpp.
References mlir::DenseIntElementsAttr::get(), mlir::get(), and getIntegerType().
Referenced by mlir::linalg::DownscaleDepthwiseConv2DNhwcHwcOp::returningMatchAndRewrite().
IntegerAttr Builder::getI8IntegerAttr | ( | int8_t | value | ) |
Definition at line 234 of file Builders.cpp.
References mlir::get(), and getIntegerType().
IntegerType Builder::getI8Type | ( | ) |
Definition at line 79 of file Builders.cpp.
References context, and mlir::get().
Referenced by mlir::LLVM::createPrintStrCall(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), splitIntegerStore(), splitVectorStore(), and unpackOperandVector().
ArrayAttr Builder::getIndexArrayAttr | ( | ArrayRef< int64_t > | values | ) |
Definition at line 294 of file Builders.cpp.
References mlir::get(), getArrayAttr(), getContext(), and getIntegerAttr().
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(), computeTargetSize(), mlir::linalg::computeTileOffsets(), constifyIndexValues(), mlir::tensor::createCanonicalRankReducingExtractSliceOp(), mlir::tensor::createCanonicalRankReducingInsertSliceOp(), mlir::memref::createCanonicalRankReducingSubViewOp(), mlir::linalg::createFoldedDimOp(), createIndex(), mlir::ConvertToLLVMPattern::createIndexAttrConstant(), createIndexAttrConstant(), mlir::tensor::createPadHighOp(), createSubViewIntersection(), expandValue(), fuse(), mlir::sparse_tensor::genToCoordinates(), mlir::sparse_tensor::genToPositions(), getCollapsedOutputDimFromInputShape(), getDimValue(), getExpandedOutputDimFromInputShape(), getFlatOffsetAndStrides(), mlir::memref::getLinearizedMemRefOffsetAndSize(), mlir::memref::getMixedSize(), mlir::tensor::getMixedSize(), mlir::sparse_tensor::getOneAttr(), mlir::tensor::getOrCreateDestination(), getOrFoldTensorDim(), getZeroAttr(), 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(), reifyValueBound(), replaceByPackingResult(), mlir::affine::resolveIndicesIntoOpWithOffsetsAndStrides(), mlir::linalg::rewriteAsPaddedOp(), mlir::linalg::rewriteInDestinationPassingStyle(), and mlir::linalg::unrollIndex().
DenseIntElementsAttr Builder::getIndexTensorAttr | ( | ArrayRef< int64_t > | values | ) |
Definition at line 209 of file Builders.cpp.
References mlir::DenseIntElementsAttr::get(), mlir::get(), and getIndexType().
IndexType Builder::getIndexType | ( | ) |
Definition at line 71 of file Builders.cpp.
References context, and mlir::get().
Referenced by mlir::arith::ConstantIndexOp::build(), mlir::bufferization::buildDeallocationLibraryFunction(), buildLinearId(), common3DIdBuilderFn(), createAsyncDispatchFunction(), createCtlzFunc(), createFor(), createForAllDimensions(), createNewDynamicSizes(), mlir::ControlFlowToSCFTransformation::createStructuredBranchRegionOp(), dumpIndexMemRef(), extractOne(), genCompressed(), genIf(), mlir::sparse_tensor::genIndexLoad(), genLoad(), mlir::sparse_tensor::genReader(), genStore(), getIndexAttr(), getIndexTensorAttr(), getIndexVectorAttr(), getLoopOverTileSlices(), mlir::sparse_tensor::getOverheadType(), mlir::sparse_tensor::LoopEmitter::initializeLoopEmit(), insertCopyLoops(), insertOne(), makeComposedMinMax(), mlir::affine::AffineDmaStartOp::parse(), mlir::affine::AffineDmaWaitOp::parse(), parseAffineMinMaxOp(), parseBound(), mlir::affine::parseDimAndSymbolList(), mlir::detail::Parser::parseNonFunctionType(), reifyConstantDim(), mlir::vector::splitFullAndPartialTransfer(), and wrapExternalFunction().
DenseIntElementsAttr Builder::getIndexVectorAttr | ( | ArrayRef< int64_t > | values | ) |
Definition at line 150 of file Builders.cpp.
References mlir::DenseIntElementsAttr::get(), mlir::get(), and getIndexType().
IntegerAttr Builder::getIntegerAttr | ( | Type | type, |
const APInt & | value | ||
) |
Definition at line 245 of file Builders.cpp.
References mlir::get().
IntegerAttr Builder::getIntegerAttr | ( | Type | type, |
int64_t | value | ||
) |
Definition at line 238 of file Builders.cpp.
References mlir::get(), mlir::Type::getIntOrFloatBitWidth(), mlir::Type::isIndex(), and mlir::Type::isSignedInteger().
Referenced by mlir::arith::ConstantIntOp::build(), convertIntegerAttr(), createConst(), createCtlzFunc(), createElementFPowIFunc(), createElementIPowIFunc(), createI32ConstantOf(), createIntConst(), createNewDynamicSizes(), createScalarOrSplatConstant(), declareReduction(), extractOne(), getIndexArrayAttr(), getOffsetForBitwidth(), mlir::sparse_tensor::getOneAttr(), getScalarConstantAsAttr(), getScalarOrVectorConstInt(), getSubByteWriteMask(), getZeroAttr(), insertOne(), ConvertAccessChain::matchAndRewrite(), mfmaConcatIfNeeded(), minusOneIntegerAttribute(), mlir::detail::Parser::parseDecOrHexAttr(), parseMapClause(), splitIntegerStore(), and wrapExternalFunction().
IntegerType Builder::getIntegerType | ( | unsigned | width | ) |
Definition at line 87 of file Builders.cpp.
References context, and mlir::get().
Referenced by allocBuffer(), broadcast(), mlir::arith::ConstantIntOp::build(), mlir::tosa::buildConvOpResultTypeInfo(), buildMatMulOpWithQuantInfo(), createEqCompare(), createLessThanCompare(), frexp(), genCompressed(), genConstInt32From(), getI16IntegerAttr(), getI32IntegerAttr(), getI32TensorAttr(), getI32VectorAttr(), getI64IntegerAttr(), getI64TensorAttr(), getI64VectorAttr(), getI8IntegerAttr(), getOffsetForBitwidth(), mlir::sparse_tensor::getOverheadType(), getSI32IntegerAttr(), getSMETileAndCastToVector(), getSubByteWriteMask(), getUI32IntegerAttr(), mlir::spirv::getUnaryOpResultType(), mlir::vector::getVectorSubscriptType(), mlir::GPUPrintfOpToLLVMCallLowering::matchAndRewrite(), mlir::GPUPrintfOpToVPrintfLowering::matchAndRewrite(), mfmaConcatIfNeeded(), mlir::detail::Parser::parseDecOrHexAttr(), parseMapClause(), mlir::detail::Parser::parseSparseElementsAttr(), parseStorageType(), shiftValue(), splitIntegerStore(), and unpackOperandVector().
IntegerType Builder::getIntegerType | ( | unsigned | width, |
bool | isSigned | ||
) |
Definition at line 91 of file Builders.cpp.
References context, mlir::get(), and mlir::quant::QuantizationFlags::Signed.
AffineMap Builder::getMultiDimIdentityMap | ( | unsigned | rank | ) |
Definition at line 376 of file Builders.cpp.
References context, mlir::AffineMap::get(), and getAffineDimExpr().
Referenced by broadcastDynamicDimension(), emitElementwiseComputation(), mlir::sparse_tensor::foreachInSparseConstant(), generateCopy(), movePaddingToFillOrGenericOp(), mlir::linalg::rewriteInDestinationPassingStyle(), and mlir::linalg::vectorizeCopy().
NamedAttribute Builder::getNamedAttr | ( | StringRef | name, |
Attribute | val | ||
) |
Definition at line 110 of file Builders.cpp.
References getStringAttr().
Referenced by mlir::convertFuncOpToLLVMFuncOp(), and mlir::impl::parseOptionalVisibilityKeyword().
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().
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 396 of file Builders.cpp.
References context, mlir::AffineMap::get(), mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumResults(), mlir::AffineMap::getNumSymbols(), and mlir::AffineMap::getResults().
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().
AffineMap Builder::getSingleDimShiftAffineMap | ( | int64_t | shift | ) |
Returns a map that shifts its (single) input dimension by 'shift'.
(d0) -> (d0 + shift)
Definition at line 390 of file Builders.cpp.
References mlir::AffineMap::get(), and getAffineDimExpr().
Referenced by constructTiledIndexSetHyperRect().
ArrayAttr Builder::getStrArrayAttr | ( | ArrayRef< StringRef > | values | ) |
Definition at line 313 of file Builders.cpp.
References getArrayAttr(), and getStringAttr().
Referenced by mlir::LLVM::ModuleImport::convertLinkerOptionsMetadata(), and mlir::spirv::getStrArrayAttrForEnumList().
StringAttr Builder::getStringAttr | ( | const Twine & | bytes | ) |
Definition at line 269 of file Builders.cpp.
References context, and mlir::get().
Referenced by addBodyWithPayloadOp(), mlir::LLVM::createGlobalString(), emitIsPositiveIndexAssertion(), mlir::DataLayoutSpecAttr::getAllocaMemorySpaceIdentifier(), getNamedAttr(), mlir::DataLayoutSpecAttr::getStackAlignmentIdentifier(), getStrArrayAttr(), hoistAffineIfOp(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), mlir::GPUPrintfOpToLLVMCallLowering::matchAndRewrite(), mlir::GPUPrintfOpToVPrintfLowering::matchAndRewrite(), mlir::DataLayoutEntryAttr::parse(), mlir::detail::Parser::parseAttributeDict(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalSymbolName(), mlir::impl::parseOptionalVisibilityKeyword(), parseVerCapExtAttr(), mlir::detail::pdl_function_builder::ProcessPDLValue< StringRef >::processAsResult(), and mlir::detail::pdl_function_builder::ProcessPDLValue< std::string >::processAsResult().
AffineMap Builder::getSymbolIdentityMap | ( | ) |
Definition at line 385 of file Builders.cpp.
References mlir::AffineMap::get(), and getAffineSymbolExpr().
Referenced by parseBound().
FloatType Builder::getTF32Type | ( | ) |
Definition at line 61 of file Builders.cpp.
References context, and mlir::FloatType::getTF32().
Referenced by mlir::detail::Parser::parseNonFunctionType().
TupleType Builder::getTupleType | ( | TypeRange | elementTypes | ) |
Definition at line 100 of file Builders.cpp.
References context, and mlir::get().
|
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(), and parseResultsValueType().
ArrayAttr Builder::getTypeArrayAttr | ( | TypeRange | values | ) |
Definition at line 319 of file Builders.cpp.
References mlir::get(), and getArrayAttr().
IntegerAttr Builder::getUI32IntegerAttr | ( | uint32_t | value | ) |
Definition at line 225 of file Builders.cpp.
References mlir::get(), and getIntegerType().
UnitAttr Builder::getUnitAttr | ( | ) |
Definition at line 114 of file Builders.cpp.
References context, and mlir::get().
Referenced by annotateConflict(), annotateNonWritableTensor(), mlir::GPUFuncOpLowering::matchAndRewrite(), outlineKernelFuncImpl(), mlir::detail::Parser::parseAttribute(), mlir::detail::Parser::parseAttributeDict(), parseCreateOperationOpResults(), mlir::detail::Parser::parseDistinctAttr(), and parseStructuredTransformDims().
Location Builder::getUnknownLoc | ( | ) |
Definition at line 27 of file Builders.cpp.
References context, and mlir::get().
Referenced by addBodyWithPayloadOp(), mlir::tosa::buildQTypeFromMinMax(), fillStructuredOpRegion(), and mlir::detail::pdl_function_builder::verifyAsArgs().
TypedAttr Builder::getZeroAttr | ( | Type | type | ) |
Definition at line 331 of file Builders.cpp.
References mlir::DenseElementsAttr::get(), getFloatAttr(), getIndexAttr(), and getIntegerAttr().
Referenced by mlir::sparse_tensor::Merger::buildExp(), mlir::sparse_tensor::constantOne(), mlir::sparse_tensor::constantZero(), handleMultidimensionalVectors(), isSupportedElementType(), mlir::linalg::lowerPack(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), mlir::linalg::pack(), reshapeLoad(), mlir::linalg::rewriteAsPaddedOp(), transposeToShuffle16x16(), and GenericPadOpVectorizationPattern::tryVectorizeCopy().
|
protected |
Definition at line 201 of file Builders.h.
Referenced by getAffineConstantExpr(), getAffineDimExpr(), getAffineSymbolExpr(), getArrayAttr(), getAttr(), getBF16Type(), getBoolAttr(), getContext(), getDenseBoolArrayAttr(), getDenseF32ArrayAttr(), getDenseF64ArrayAttr(), getDenseI16ArrayAttr(), getDenseI32ArrayAttr(), getDenseI64ArrayAttr(), getDenseI8ArrayAttr(), getDictionaryAttr(), getEmptyAffineMap(), getF128Type(), getF16Type(), getF32Type(), getF64Type(), getF80Type(), getFloat8E4M3B11FNUZType(), getFloat8E4M3FNType(), getFloat8E4M3FNUZType(), getFloat8E5M2FNUZType(), getFloat8E5M2Type(), getFunctionType(), getFusedLoc(), getI16Type(), getI1Type(), getI2Type(), getI32Type(), getI4Type(), getI64Type(), getI8Type(), getIndexType(), getIntegerType(), getMultiDimIdentityMap(), getNoneType(), getShiftedAffineMap(), getStringAttr(), getTF32Type(), getTupleType(), getType(), getUnitAttr(), and getUnknownLoc().