|
MLIR 24.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 | getF8E8M0Type () |
| FloatType | getF8E5M3FNUType () |
| FloatType | getF8E4M3FNType () |
| FloatType | getF8E5M2Type () |
| 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) |
| GraphType | getGraphType (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. | |
| template<typename Attr, typename... Args> | |
| Attr | getAttr (Args &&...args) |
| Get or construct an instance of the attribute Attr with provided arguments. | |
| 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. | |
| IntegerAttr | getUI32IntegerAttr (uint32_t value) |
| DenseIntElementsAttr | getBoolVectorAttr (ArrayRef< bool > values) |
| Vector-typed DenseIntElementsAttr getters. values must not be empty. | |
| 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. | |
| DenseIntElementsAttr | getI64TensorAttr (ArrayRef< int64_t > values) |
| DenseIntElementsAttr | getIndexTensorAttr (ArrayRef< int64_t > values) |
| DenseBoolArrayAttr | getDenseBoolArrayAttr (ArrayRef< bool > values) |
| Tensor-typed DenseArrayAttr getters. | |
| 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: () -> (). | |
| AffineMap | getConstantAffineMap (int64_t val) |
| Returns a single constant result affine map with 0 dimensions and 0 symbols. | |
| AffineMap | getDimIdentityMap () |
| AffineMap | getMultiDimIdentityMap (unsigned rank) |
| AffineMap | getSymbolIdentityMap () |
| AffineMap | getSingleDimShiftAffineMap (int64_t shift) |
| Returns a map that shifts its (single) input dimension by 'shift'. | |
| AffineMap | getShiftedAffineMap (AffineMap map, int64_t shift) |
| Returns an affine map that is a translation (shift) of all result expressions in 'map' by 'shift'. | |
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 51 of file Builders.h.
|
inlineexplicit |
Definition at line 53 of file Builders.h.
References context.
Referenced by Builder(), and mlir::OpBuilder::OpBuilder().
|
inlineexplicit |
Definition at line 54 of file Builders.h.
References Builder(), and getContext().
| AffineExpr Builder::getAffineConstantExpr | ( | int64_t | constant | ) |
Definition at line 381 of file Builders.cpp.
References context, and mlir::getAffineConstantExpr().
Referenced by broadcastDynamicDimension(), getBroadcastingMap(), getConstantAffineMap(), mlir::memref::getLinearizedMemRefOffsetAndSize(), mlir::linalg::rewriteInIm2Col(), and mlir::affine::simplifyConstrainedMinMaxOp().
| AffineExpr Builder::getAffineDimExpr | ( | unsigned | position | ) |
Definition at line 373 of file Builders.cpp.
References context, and mlir::getAffineDimExpr().
Referenced by mlir::alignAffineMapWithValues(), broadcastDynamicDimension(), createDepthwiseConvCollapseMap(), mlir::memref::createFoldMemRefAliasOpsPass(), doubleBuffer(), forEachIJPairInAllBuffers(), getBroadcastingMap(), getDimIdentityMap(), mlir::linalg::getIm2ColInputExpressions(), getMultiDimIdentityMap(), getSingleDimShiftAffineMap(), getXferIndices(), mlir::affine::loopUnrollJamByFactor(), packLinalgMetadataOnce(), processParallelLoop(), reduceMatchAndRewriteHelper(), mlir::linalg::rewriteInIm2Col(), mlir::linalg::rewriteInIm2Col(), mlir::linalg::rewriteInIm2Col(), mlir::linalg::rewriteInIm2Col(), and mlir::affine::simplifyConstrainedMinMaxOp().
Definition at line 327 of file Builders.cpp.
References getArrayAttr().
Referenced by mlir::linalg::deduplicateOperandsAndRemoveDeadResults(), mlir::linalg::fuseElementwiseOps(), mlir::linalg::interchangeGenericOp(), CanonicalizeContractMatmulToMMT::matchAndRewrite(), specializeLinalgElementwise(), and translateMap().
| AffineExpr Builder::getAffineSymbolExpr | ( | unsigned | position | ) |
Definition at line 377 of file Builders.cpp.
References context, and mlir::getAffineSymbolExpr().
Referenced by mlir::alignAffineMapWithValues(), mlir::linalg::computeMultiTileSizes(), getCollapsedOutputDimFromInputShape(), getSymbolIdentityMap(), processParallelLoop(), and mlir::affine::simplifyConstrainedMinMaxOp().
Definition at line 275 of file Builders.cpp.
References context.
Referenced by mlir::call_interface_impl::addArgAndResultAttrs(), buildQuantifier(), mlir::sparse_tensor::constantOne(), mlir::sparse_tensor::constantZero(), convertModuleFlagValueFromMDTuple(), deserializeCacheControlDecoration(), mlir::sparse_tensor::LoopEmitter::enterCurrentCoIterationCase(), eraseRedundantGpuBarrierOps(), generateLoopNestUsingForallOp(), mlir::sparse_tensor::genValFromAttr(), getAffineMapArrayAttr(), getBoolArrayAttr(), getF32ArrayAttr(), getF64ArrayAttr(), getI32ArrayAttr(), getI64ArrayAttr(), getIndexArrayAttr(), getKnownOrOcklDim(), getLaneId(), getLLVMAlignParamForCompressExpand(), getStrArrayAttr(), getTypeArrayAttr(), handleByValArgumentInit(), mlir::linalg::interchangeGenericOp(), ArithmeticExtendedBinaryFold< spirv::IAddCarryOp >::matchAndRewrite(), MulExtendedFold< spirv::SMulExtendedOp, true >::matchAndRewrite(), parseAttributesOp(), parseAttributions(), parseCreateOperationOpAttributes(), parseForeachMatchSymbols(), parseOperationOpAttributes(), parseVerCapExtAttr(), and translateMap().
|
inline |
Get or construct an instance of the attribute Attr with provided arguments.
Definition at line 101 of file Builders.h.
References context.
Referenced by addBlockScaleProperties(), mlir::tosa::buildConvOpQuantizationAttr(), mlir::tosa::buildMatMulOpQuantizationAttr(), mlir::tosa::buildPadOpQuantizationAttr(), mlir::tosa::buildUnaryOpQuantizationAttr(), convertVecTypeHint(), deserializeCacheControlDecoration(), mlir::spirv::parseControlAttribute(), mlir::spirv::parseEnumKeywordAttr(), mlir::spirv::parseEnumStrAttr(), and parseOffloadingHandler().
| FloatType Builder::getBF16Type | ( | ) |
Definition at line 45 of file Builders.cpp.
References context.
Definition at line 279 of file Builders.cpp.
References getArrayAttr(), and getBoolAttr().
Referenced by buildVectorWrite(), inverseTransposeInBoundsAttr(), VectorizationState::maskOperation(), and vectorizeAsLinalgGeneric().
Definition at line 108 of file Builders.cpp.
References context, and mlir::BoolAttr::get().
Referenced by boolCst(), buildBoolValue(), buildBoolValue(), mlir::bufferization::buildDeallocationLibraryFunction(), convertBarrierSyncIntrinsic(), convertBoolAttr(), getBoolArrayAttr(), and reduceMatchAndRewriteHelper().
| DenseIntElementsAttr Builder::getBoolVectorAttr | ( | ArrayRef< bool > | values | ) |
Vector-typed DenseIntElementsAttr getters. values must not be empty.
Definition at line 124 of file Builders.cpp.
References mlir::DenseIntElementsAttr::get(), and getI1Type().
Returns a single constant result affine map with 0 dimensions and 0 symbols.
One constant result: () -> (val).
Definition at line 387 of file Builders.cpp.
References mlir::AffineMap::get(), and getAffineConstantExpr().
Referenced by parseBound(), and mlir::memref::resolveSourceIndicesCollapseShape().
|
inline |
Definition at line 56 of file Builders.h.
References context.
Referenced by addAtomicRMW(), addBlockScaleProperties(), addComdat(), adjustMap(), allocateSubviewGPUMemoryInAddressSpace(), broadcastDynamicDimension(), Builder(), buildLinearId(), mlir::GPUFuncOpLowering::buildLoweredGPULLVMFuncAttrs(), buildQuantifier(), castToElemPtrPtr(), common3DIdBuilderFn(), computeIteratorTypesAndIndexingMaps(), mlir::linalg::computePaddedShape(), mlir::linalg::computeSliceParameters(), mlir::memref::computeSuffixProductIRBlockImpl(), convertIntrinsicResult(), createAsyncDispatchFunction(), createCtlzFunc(), createElementFPowIFunc(), createElementIPowIFunc(), createGroupNonUniformBitwiseReduceOpImpl(), createGroupReduceOpImpl(), createI32ConstantOf(), mlir::acc::createIdent(), createInitialTensorsForTiling(), mlir::quant::createLowerQuantOps(), mlir::LLVM::createPrintStrCall(), mlir::acc::createRuntimeCall(), mlir::gpu::WarpDistributionPattern::delinearizeLaneId(), denormalizeInductionVariableForIndexType(), denormalizeIndVar(), mlir::linalg::dropUnitDims(), mlir::tensor::ExtractSliceFromCollapseHelper::emitLoopNestBody(), emitNormalizedLoopBoundsForIndexType(), mlir::impl::ensureRegionTerminator(), forEachIJPairInAllBuffers(), getBroadcastingMap(), getCompressedMaskOp(), mlir::AsmParser::getContext(), mlir::linalg::getIm2ColInputExpressions(), getIndexArrayAttr(), getIndexingMapInExpandedOp(), getIndicesForLoadOrStore(), getLaneId(), getLibraryCallSymbolRef(), mlir::memref::getLinearizedMemRefOffsetAndSize(), mlir::memref::getLinearizedMemRefOffsetAndSize(), getOffsetForBitwidth(), mlir::sparse_tensor::getOpaquePointerType(), mlir::acc::getOrCreateGlobalString(), getProductOfIndexes(), getScalarConstantAsAttr(), getSplitReductionIvs(), getTileOffsetAndSizesWithForAllOp(), mlir::tosa::getTosaConstShape(), getUserTileSizesAndNumThreads(), laneIdBuilderFn(), mlir::linalg::lowerPack(), CanonicalizeContractMatmulToMMT::matchAndRewrite(), ClampClampOptimization::matchAndRewrite(), DeduplicateAffineMinMaxExpressions< T >::matchAndRewrite(), MergeAffineMinMaxOp< T >::matchAndRewrite(), MLGOAddReflectionMapClass::matchAndRewrite(), mlir::OpToFuncCallLowering< SourceOp >::maybeCast(), mlir::dataflow::maybeReplaceWithConstant(), mlir::affine::mergeOffsetsSizesAndStrides(), movePaddingToFillOrGenericOp(), mlir::memref::multiBuffer(), normalizeUpperBounds(), mlir::OpBuilder::OpBuilder(), mlir::OpBuilder::OpBuilder(), mlir::OpBuilder::OpBuilder(), mlir::outlineSingleBlockRegion(), mlir::linalg::packMatmulGreedily(), parseNamedValueListImpl(), parseScheduleClause(), parseValueWithVariadicity(), mlir::LLVMTypeConverter::promoteOneMemRefDescriptor(), mlir::affine::resolveIndicesIntoOpWithOffsetsAndStrides(), mlir::linalg::rewriteInIm2Col(), mlir::linalg::rewriteInIm2Col(), mlir::linalg::rewriteInIm2Col(), mlir::linalg::rewriteInIm2Col(), setProfilingAttr(), mlir::UnrankedMemRefDescriptor::setSize(), mlir::UnrankedMemRefDescriptor::setStride(), simplifyAffineMinMaxOp(), mlir::affine::simplifyAffineMinMaxOps(), mlir::MemRefDescriptor::size(), mlir::UnrankedMemRefDescriptor::size(), mlir::UnrankedMemRefDescriptor::sizeBasePtr(), specializeLinalgElementwise(), mlir::linalg::splitOp(), mlir::UnrankedMemRefDescriptor::stride(), mlir::UnrankedMemRefDescriptor::strideBasePtr(), mlir::x86::avx2::transpose4x8xf32(), mlir::x86::avx2::transpose8x8xf32(), transposeOneLinalgOperandAndReplace(), mlir::shard::UpdateHaloPattern::tryApply(), updateExpandedGenericOpRegion(), vectorizeTensorExtract(), and wrapExternalFunction().
| DenseBoolArrayAttr Builder::getDenseBoolArrayAttr | ( | ArrayRef< bool > | values | ) |
Tensor-typed DenseArrayAttr getters.
Definition at line 159 of file Builders.cpp.
References context, and mlir::detail::DenseArrayAttrImpl< bool >::get().
Referenced by mlir::parseDynamicIndexList(), and mlir::acc::tileACCLoops().
| DenseF32ArrayAttr Builder::getDenseF32ArrayAttr | ( | ArrayRef< float > | values | ) |
Definition at line 179 of file Builders.cpp.
References context, and mlir::detail::DenseArrayAttrImpl< float >::get().
| DenseF64ArrayAttr Builder::getDenseF64ArrayAttr | ( | ArrayRef< double > | values | ) |
Definition at line 183 of file Builders.cpp.
References context, and mlir::detail::DenseArrayAttrImpl< double >::get().
| DenseI16ArrayAttr Builder::getDenseI16ArrayAttr | ( | ArrayRef< int16_t > | values | ) |
Definition at line 167 of file Builders.cpp.
References context, and mlir::detail::DenseArrayAttrImpl< int16_t >::get().
| DenseI32ArrayAttr Builder::getDenseI32ArrayAttr | ( | ArrayRef< int32_t > | values | ) |
Definition at line 171 of file Builders.cpp.
References context, and mlir::detail::DenseArrayAttrImpl< int32_t >::get().
Referenced by mlir::gpu::addAsyncDependency(), convertDenseI32Array(), mlir::ROCDL::getAMDHSAKernelsELFMetadata(), ConsolidateTransposeOptimization::matchAndRewrite(), and parseCommonStructuredOpParts().
| DenseI64ArrayAttr Builder::getDenseI64ArrayAttr | ( | ArrayRef< int64_t > | values | ) |
Definition at line 175 of file Builders.cpp.
References context, and mlir::detail::DenseArrayAttrImpl< int64_t >::get().
Referenced by AvgPool2dAdaptiveToAvgPool2d::matchAndRewrite(), MaxPool2dAdaptiveToMaxPool2d::matchAndRewrite(), mlir::parseDynamicIndexList(), mlir::transform::parsePackedOrDynamicIndexList(), parseSwitchCases(), parseSwitchCases(), and mlir::transform::parseTransformMatchDims().
| DenseI8ArrayAttr Builder::getDenseI8ArrayAttr | ( | ArrayRef< int8_t > | values | ) |
Definition at line 163 of file Builders.cpp.
References context, and mlir::detail::DenseArrayAttrImpl< int8_t >::get().
| DictionaryAttr Builder::getDictionaryAttr | ( | ArrayRef< NamedAttribute > | value | ) |
Definition at line 112 of file Builders.cpp.
References context.
Referenced by mlir::call_interface_impl::addArgAndResultAttrs(), mlir::ROCDL::getKernelMetadata(), getKnownOrOcklDim(), getLaneId(), getLLVMAlignParamForCompressExpand(), handleArgumentImpl(), handleByValArgumentInit(), handleResultImpl(), parseAttributions(), and propagateArgResAttrs().
| AffineMap Builder::getDimIdentityMap | ( | ) |
Definition at line 392 of file Builders.cpp.
References mlir::AffineMap::get(), and getAffineDimExpr().
Referenced by buildAffineLoopFromValues(), and mlir::affine::promoteIfSingleIteration().
| AffineMap Builder::getEmptyAffineMap | ( | ) |
Returns a zero result affine map with no dimensions or symbols: () -> ().
Definition at line 385 of file Builders.cpp.
References context, and mlir::AffineMap::get().
| FloatType Builder::getF128Type | ( | ) |
Definition at line 57 of file Builders.cpp.
References context.
| FloatAttr Builder::getF16FloatAttr | ( | float | value | ) |
Definition at line 259 of file Builders.cpp.
References getF16Type().
| FloatType Builder::getF16Type | ( | ) |
Definition at line 47 of file Builders.cpp.
References context.
Referenced by convertIntrinsicResult(), and getF16FloatAttr().
Definition at line 303 of file Builders.cpp.
References getArrayAttr(), and getF32FloatAttr().
| FloatAttr Builder::getF32FloatAttr | ( | float | value | ) |
Definition at line 255 of file Builders.cpp.
References getF32Type().
Referenced by convertFloatAttr(), f32Cst(), genConstFloat32From(), and getF32ArrayAttr().
| FloatType Builder::getF32Type | ( | ) |
Definition at line 51 of file Builders.cpp.
References context.
Referenced by castToF32(), convertIntrinsicResult(), mlir::tosa::createZPsAsConst(), exp2I32(), f32FromBits(), frexp(), genConstFloat32From(), getF32FloatAttr(), getF32VectorAttr(), insertCasts(), VectorContractBF16ToFMA::matchAndRewrite(), and reduceMatchAndRewriteHelper().
| DenseFPElementsAttr Builder::getF32VectorAttr | ( | ArrayRef< float > | values | ) |
Definition at line 148 of file Builders.cpp.
References mlir::DenseFPElementsAttr::get(), and getF32Type().
Definition at line 309 of file Builders.cpp.
References getArrayAttr(), and getF64FloatAttr().
| FloatAttr Builder::getF64FloatAttr | ( | double | value | ) |
Definition at line 251 of file Builders.cpp.
References getF64Type().
Referenced by getF64ArrayAttr().
| FloatType Builder::getF64Type | ( | ) |
Definition at line 53 of file Builders.cpp.
References context.
Referenced by convertIntrinsicResult(), getF64FloatAttr(), and getF64VectorAttr().
| DenseFPElementsAttr Builder::getF64VectorAttr | ( | ArrayRef< double > | values | ) |
Definition at line 153 of file Builders.cpp.
References mlir::DenseFPElementsAttr::get(), and getF64Type().
| FloatType Builder::getF80Type | ( | ) |
Definition at line 55 of file Builders.cpp.
References context.
| FloatType Builder::getF8E4M3FNType | ( | ) |
Definition at line 41 of file Builders.cpp.
References context.
| FloatType Builder::getF8E5M2Type | ( | ) |
Definition at line 43 of file Builders.cpp.
References context.
| FloatType Builder::getF8E5M3FNUType | ( | ) |
Definition at line 37 of file Builders.cpp.
References context.
| FloatType Builder::getF8E8M0Type | ( | ) |
Definition at line 35 of file Builders.cpp.
References context.
| FloatAttr Builder::getFloatAttr | ( | Type | type, |
| const APFloat & | value ) |
Definition at line 267 of file Builders.cpp.
| FloatAttr Builder::getFloatAttr | ( | Type | type, |
| double | value ) |
Definition at line 263 of file Builders.cpp.
Referenced by mlir::arith::ConstantFloatOp::build(), createElementFPowIFunc(), createFloatConst(), createFPConstant(), createInitialValueForReduceOp(), mlir::tosa::createPadConstTensor(), mlir::xegpu::createReductionNeutralValue(), mlir::createScalarOrSplatConstant(), mlir::tosa::createZeroPointTensor(), declareReduction(), floatCst(), mlir::arith::getIdentityValueAttr(), getOneAttr(), mlir::sparse_tensor::getOneAttr(), getScalarConstantAsAttr(), getZeroAttr(), ClampClampOptimization::matchAndRewrite(), and reduceMatchAndRewriteHelper().
Definition at line 84 of file Builders.cpp.
References context.
Referenced by mlir::bufferization::buildDeallocationLibraryFunction(), createAsyncDispatchFunction(), getLibraryCallSymbolRef(), and getParallelComputeFunctionType().
Definition at line 27 of file Builders.cpp.
References context.
Referenced by generateLocationsFromIR().
Definition at line 88 of file Builders.cpp.
References context.
| IntegerAttr Builder::getI16IntegerAttr | ( | int16_t | value | ) |
Definition at line 225 of file Builders.cpp.
References getIntegerType().
Referenced by getTileSizes().
| IntegerType Builder::getI16Type | ( | ) |
Definition at line 69 of file Builders.cpp.
References context.
| IntegerType Builder::getI1Type | ( | ) |
Definition at line 61 of file Builders.cpp.
References context.
Referenced by mlir::bufferization::buildDeallocationLibraryFunction(), mlir::linalg::createDestinationPassingStyleInitOperand(), mlir::vector::createReadOrMaskedRead(), mlir::ControlFlowToSCFTransformation::createStructuredDoWhileLoopOp(), mlir::vector::createWriteOrMaskedWrite(), genExpand(), getBoolVectorAttr(), getCompressedMaskOp(), and vectorizeTensorExtract().
| IntegerType Builder::getI2Type | ( | ) |
Definition at line 63 of file Builders.cpp.
References context.
Definition at line 285 of file Builders.cpp.
References getArrayAttr(), and getI32IntegerAttr().
| IntegerAttr Builder::getI32IntegerAttr | ( | int32_t | value | ) |
Definition at line 208 of file Builders.cpp.
References getIntegerType().
Referenced by convertIntegerMD(), convertIntrinsicResult(), mlir::ControlFlowToSCFTransformation::getCFGSwitchValue(), getI32ArrayAttr(), mlir::spirv::getPushConstantValue(), getScalarOrVectorI32Constant(), i32Cst(), parseInterfaceVarABIAttr(), mlir::amdgpu::parseMNKDimensionList(), and parseVerCapExtAttr().
| 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 187 of file Builders.cpp.
References mlir::DenseIntElementsAttr::get(), and getIntegerType().
| IntegerType Builder::getI32Type | ( | ) |
Definition at line 71 of file Builders.cpp.
References context.
Referenced by mlir::tosa::buildConvOpResultTypeInfo(), buildMatMulLikeOpWithQuantInfo(), convertIntrinsicResult(), createGroupNonUniformBitwiseReduceOpImpl(), createGroupReduceOpImpl(), createI32Constant(), createI32ConstantOf(), and mlir::acc::createIdent().
| DenseIntElementsAttr Builder::getI32VectorAttr | ( | ArrayRef< int32_t > | values | ) |
Definition at line 130 of file Builders.cpp.
References mlir::DenseIntElementsAttr::get(), and getIntegerType().
Referenced by getScalarOrVectorI32Constant().
| IntegerType Builder::getI4Type | ( | ) |
Definition at line 290 of file Builders.cpp.
References getArrayAttr(), and getI64IntegerAttr().
Referenced by convertContractOpToMmaSync(), mlir::vector::getVectorSubscriptAttr(), staticallyExtractSubvector(), and staticallyInsertSubvector().
| IntegerAttr Builder::getI64IntegerAttr | ( | int64_t | value | ) |
Definition at line 120 of file Builders.cpp.
References getIntegerType().
Referenced by computeStrideInBytes(), mlir::sparse_tensor::LoopEmitter::enterCurrentCoIterationCase(), mlir::ROCDL::getAMDHSAKernelsELFMetadata(), getI64ArrayAttr(), getKnownOrOcklDim(), getLLVMAlignParamForCompressExpand(), mlir::linalg::getMixedTilesImpl(), handleByValArgumentInit(), inferStride(), parseCmpOp(), parseCommonGlobalAndAlias(), and parseUsedCoordList().
| DenseIntElementsAttr Builder::getI64TensorAttr | ( | ArrayRef< int64_t > | values | ) |
Definition at line 194 of file Builders.cpp.
References mlir::DenseIntElementsAttr::get(), and getIntegerType().
| IntegerType Builder::getI64Type | ( | ) |
Definition at line 73 of file Builders.cpp.
References context.
Referenced by mlir::acc::createIdent(), mlir::sparse_tensor::genIndexLoad(), mlir::bufferization::getGlobalFor(), mlir::acc::getOrCreateGlobalString(), handleByValArgumentInit(), BinaryArithOpToAPFloatConversion< OpTy >::matchAndRewrite(), FmaOpToAPFloatConversion::matchAndRewrite(), FpToFpConversion< OpTy >::matchAndRewrite(), FpToIntConversion< OpTy >::matchAndRewrite(), matchAndRewriteSortOp(), parseSynchronizationHint(), and mlir::LLVMTypeConverter::promoteOneMemRefDescriptor().
| DenseIntElementsAttr Builder::getI64VectorAttr | ( | ArrayRef< int64_t > | values | ) |
Definition at line 136 of file Builders.cpp.
References mlir::DenseIntElementsAttr::get(), and getIntegerType().
| IntegerAttr Builder::getI8IntegerAttr | ( | int8_t | value | ) |
Definition at line 230 of file Builders.cpp.
References getIntegerType().
| IntegerType Builder::getI8Type | ( | ) |
Definition at line 67 of file Builders.cpp.
References context.
Referenced by bitcastSubByteVectorToI8(), mlir::LLVM::createPrintStrCall(), and getOrCreateGlobalStringOp().
Definition at line 296 of file Builders.cpp.
References getArrayAttr(), getContext(), and getIntegerAttr().
| IntegerAttr Builder::getIndexAttr | ( | int64_t | value | ) |
Definition at line 116 of file Builders.cpp.
References getIndexType().
Referenced by applyPad(), mlir::linalg::blockPackMatmul(), mlir::arith::ConstantIndexOp::build(), mlir::bufferization::buildDeallocationLibraryFunction(), buildPackingLoopNestImpl(), mlir::linalg::computeIndexingMapOpInterfacePaddedShape(), mlir::linalg::computeSliceParameters(), mlir::memref::computeSuffixProductIRBlock(), computeTargetSize(), constifyIndexValues(), convertTransferReadOp(), convertTransferWriteOp(), convertTransferWriteToStores(), mlir::nvgpu::createAsyncGroups(), mlir::acc::createIdent(), createIndex(), createIndexAttrConstant(), mlir::ConvertToLLVMPattern::createIndexAttrConstant(), createNonLdMatrixLoads(), emitNormalizedLoopBoundsForIndexType(), foldExtractFromBroadcast(), generateLoopNestUsingForallOp(), generateLoopNestUsingForOp(), getCollapsedOutputDimFromInputShape(), getDimValue(), mlir::memref::getLinearizedMemRefOffsetAndSize(), mlir::memref::getLinearizedMemRefOffsetAndSize(), mlir::bufferization::DeallocationState::getMemrefsAndConditionsToDeallocate(), mlir::memref::getMixedSize(), mlir::tensor::getMixedSize(), mlir::linalg::getNewMixedTileSizes(), getOneAttr(), mlir::sparse_tensor::getOneAttr(), mlir::acc::getOrCreateGlobalString(), getOrFoldTensorDim(), getProductOfIndexes(), getSplitReductionIvs(), mlir::LLVM::getStridedElementPtr(), getSubviewFromVectorInput(), getTileOffsetAndSizesWithForAllOp(), getUserTileSizesAndNumThreads(), getZeroAttr(), mlir::ValueBoundsConstraintSet::isProvablyNegative(), mlir::ValueBoundsConstraintSet::isProvablyNonNegative(), mlir::ValueBoundsConstraintSet::isProvablyNonPositive(), mlir::ValueBoundsConstraintSet::isProvablyPositive(), mlir::loopUnrollJamByFactor(), mlir::linalg::lowerPack(), mlir::linalg::lowerUnPack(), ExpandShapeOpMemRefCastFolder::matchAndRewrite(), mlir::ComposeCollapseOfExpandOp< CollapseOpTy, ExpandOpTy, CastOpTy, DimOpTy, TensorTy >::matchAndRewrite(), mlir::linalg::DecomposeOuterUnitDimsPackOpPattern::matchAndRewrite(), mlir::linalg::DecomposeOuterUnitDimsUnPackOpPattern::matchAndRewrite(), mlir::linalg::DecomposePadOpPattern::matchAndRewrite(), mlir::memref::multiBuffer(), normalizeForallLoopOp(), mlir::linalg::packMatmulGreedily(), parseAlternativesOpSelectedRegion(), mlir::LLVMTypeConverter::promoteOneMemRefDescriptor(), rankReducingSubviewDroppingUnitDims(), replaceByPackingResult(), mlir::tensor::replaceExtractSliceWithTiledProducer(), replaceForAllWithNewSignature(), mlir::affine::resolveIndicesIntoOpWithOffsetsAndStrides(), mlir::linalg::rewriteAsPaddedOp(), mlir::linalg::rewriteAsPaddedOp(), mlir::linalg::rewriteInDestinationPassingStyle(), mlir::tensor::simplifyCollapseShapeWithRankReducingExtractSlice(), tileAndFuseConsumerOfSlicesImpl(), and mlir::yieldReplacementForFusedProducer().
| DenseIntElementsAttr Builder::getIndexTensorAttr | ( | ArrayRef< int64_t > | values | ) |
Definition at line 201 of file Builders.cpp.
References mlir::DenseIntElementsAttr::get(), and getIndexType().
Referenced by buildVariableOp(), and mlir::tosa::getTosaConstShape().
| IndexType Builder::getIndexType | ( | ) |
Definition at line 59 of file Builders.cpp.
References context.
Referenced by mlir::linalg::blockPackMatmul(), mlir::arith::ConstantIndexOp::build(), mlir::acc::buildComputeRegion(), mlir::bufferization::buildDeallocationLibraryFunction(), buildLinearId(), calculateGatherOffset(), common3DIdBuilderFn(), convertTransferWriteToStores(), convVals(), createAsyncDispatchFunction(), mlir::shard::createCollectiveProcessGroupSize(), createCtlzFunc(), createFor(), createForAllDimensions(), mlir::arm_sme::createLoopOverTileSlices(), mlir::quant::createLowerQuantOps(), createNonLdMatrixLoads(), mlir::ControlFlowToSCFTransformation::createStructuredBranchRegionOp(), doSequentialDispatch(), dumpIndexMemRef(), dynamicallyExtractSubVector(), dynamicallyInsertSubVector(), mlir::sparse_tensor::LoopEmitter::enterCurrentCoIterationCase(), genCompressed(), genExpand(), genIf(), mlir::sparse_tensor::genIndexLoad(), genInsertionStore(), genLoad(), mlir::sparse_tensor::genReader(), genStore(), getIndexAttr(), getIndexTensorAttr(), getIndexVectorAttr(), mlir::sparse_tensor::getOverheadType(), getParallelComputeFunctionType(), parseAffineMinMaxOp(), parseBound(), mlir::affine::parseDimAndSymbolList(), parseLevelRange(), parseUsedCoordList(), vectorizeLinalgIndex(), vectorizeTensorExtract(), and wrapExternalFunction().
| DenseIntElementsAttr Builder::getIndexVectorAttr | ( | ArrayRef< int64_t > | values | ) |
Definition at line 142 of file Builders.cpp.
References mlir::DenseIntElementsAttr::get(), and getIndexType().
| IntegerAttr Builder::getIntegerAttr | ( | Type | type, |
| const APInt & | value ) |
Definition at line 247 of file Builders.cpp.
Definition at line 237 of file Builders.cpp.
References mlir::Type::getIntOrFloatBitWidth(), mlir::Type::isIndex(), and mlir::Type::isSignedInteger().
Referenced by adjustAccessChainForBitwidth(), mlir::arith::ConstantIntOp::build(), mlir::arith::ConstantIntOp::build(), mlir::arith::ConstantIntOp::build(), buildQuantifier(), ceilDivPositive(), convertIntegerAttr(), createConst(), createConstantAllBitsSet(), createCtlzFunc(), createElementFPowIFunc(), createElementIPowIFunc(), createExtractAndCast(), createGroupNonUniformBitwiseReduceOpImpl(), createGroupReduceOpImpl(), createI32ConstantOf(), createInitialValueForReduceOp(), createInsertAndCast(), mlir::tosa::createPadConstTensor(), mlir::xegpu::createReductionNeutralValue(), mlir::createScalarOrSplatConstant(), mlir::tosa::createZeroPointTensor(), declareReduction(), mlir::arith::getIdentityValueAttr(), getIndexArrayAttr(), getOffsetForBitwidth(), getOneAttr(), mlir::sparse_tensor::getOneAttr(), getScalarConstantAsAttr(), getScalarOrVectorConstInt(), getSubByteWriteMask(), getZeroAttr(), mlir::loopUnrollByFactor(), ClampClampOptimization::matchAndRewrite(), CmpFIntToFPConst::matchAndRewrite(), CmpFOpToAPFloatConversion::matchAndRewrite(), mlir::dataflow::maybeReplaceWithConstant(), resolveAndCastTileSize(), mlir::acc::tileACCLoops(), and wrapExternalFunction().
| IntegerType Builder::getIntegerType | ( | unsigned | width | ) |
Definition at line 75 of file Builders.cpp.
References context.
Referenced by mlir::arith::ConstantIntOp::build(), mlir::tosa::buildConvOpResultTypeInfo(), buildMatMulLikeOpWithQuantInfo(), buildQuantifier(), castToSameSizedInt(), composeValueImpl(), computeStrideInBytes(), convertCeilOp(), convertRoundEvenOp(), createEqCompare(), createExtractAndCast(), createLessThanCompare(), decomposeValueImpl(), frexp(), genCompressed(), genConstInt32From(), mlir::tosa::getConstTensorInt(), getI16IntegerAttr(), getI32IntegerAttr(), getI32TensorAttr(), getI32VectorAttr(), getI64IntegerAttr(), getI64TensorAttr(), getI64VectorAttr(), getI8IntegerAttr(), mlir::spirv::getMatchingBoolType(), getOffsetForBitwidth(), mlir::sparse_tensor::getOverheadType(), getSI32IntegerAttr(), getSubByteWriteMask(), getTileSizes(), getUI32IntegerAttr(), mlir::vector::getVectorSubscriptType(), inferStride(), FmaOpToAPFloatConversion::matchAndRewrite(), FpToFpConversion< OpTy >::matchAndRewrite(), mlir::spirv::parseMemoryAccessAttributes(), mlir::spirv::parseSourceMemoryAccessAttributes(), parseStorageType(), mlir::spirv::parseVariableDecorations(), and shiftValue().
Definition at line 79 of file Builders.cpp.
References context.
Definition at line 396 of file Builders.cpp.
References context, mlir::AffineMap::get(), and getAffineDimExpr().
Referenced by broadcastDynamicDimension(), mlir::sparse_tensor::foreachInSparseConstant(), linalgBroadcastAndMaybeExt(), movePaddingToFillOrGenericOp(), reduceMatchAndRewriteHelper(), mlir::linalg::rewriteInDestinationPassingStyle(), vectorizeAffineLoad(), and vectorizeAffineStore().
| NamedAttribute Builder::getNamedAttr | ( | StringRef | name, |
| Attribute | val ) |
Definition at line 102 of file Builders.cpp.
Referenced by getKnownOrOcklDim(), getLaneId(), getLLVMAlignParamForCompressExpand(), handleByValArgumentInit(), and mlir::impl::parseOptionalVisibilityKeyword().
| NoneType Builder::getNoneType | ( | ) |
Definition at line 96 of file Builders.cpp.
References context.
Referenced by mlir::spirv::parseEnumStrAttr().
| TypedAttr Builder::getOneAttr | ( | Type | type | ) |
Definition at line 351 of file Builders.cpp.
References mlir::DenseElementsAttr::get(), getFloatAttr(), getIndexAttr(), getIntegerAttr(), and getOneAttr().
Referenced by ceilDivPositive(), mlir::arith::createProduct(), mlir::xegpu::createReductionNeutralValue(), mlir::emitNormalizedLoopBounds(), getOneAttr(), and getProductOfIntsOrIndexes().
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 416 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 215 of file Builders.cpp.
References getIntegerType().
Returns a map that shifts its (single) input dimension by 'shift'.
(d0) -> (d0 + shift)
Definition at line 410 of file Builders.cpp.
References mlir::AffineMap::get(), and getAffineDimExpr().
Definition at line 315 of file Builders.cpp.
References getArrayAttr(), and getStringAttr().
Referenced by mlir::spirv::getStrArrayAttrForEnumList().
| StringAttr Builder::getStringAttr | ( | const Twine & | bytes | ) |
Definition at line 271 of file Builders.cpp.
References context.
Referenced by mlir::GPUFuncOpLowering::buildLoweredGPULLVMFuncAttrs(), buildQuantifier(), mlir::detail::ConversionPatternRewriterImpl::buildUnresolvedMaterialization(), buildVariableOp(), mlir::linalg::computeMultiTileSizes(), convertModuleFlagValueFromMDTuple(), generateLocationsFromIR(), mlir::ROCDL::getAMDHSAKernelsELFMetadata(), mlir::bufferization::getGlobalFor(), getLocFromDebugInfoString(), getOrCreateGlobalStringOp(), getStrArrayAttr(), mlir::LLVM::detail::intrinsicRewrite(), WrapFuncInClass::matchAndRewrite(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalSymbolName(), mlir::impl::parseOptionalVisibilityKeyword(), parseSymbolVisibility(), and parseVerCapExtAttr().
| AffineMap Builder::getSymbolIdentityMap | ( | ) |
Definition at line 405 of file Builders.cpp.
References mlir::AffineMap::get(), and getAffineSymbolExpr().
Referenced by parseBound().
| FloatType Builder::getTF32Type | ( | ) |
Definition at line 49 of file Builders.cpp.
References context.
| TupleType Builder::getTupleType | ( | TypeRange | elementTypes | ) |
Definition at line 92 of file Builders.cpp.
References context.
|
inline |
Get or construct an instance of the type Ty with provided arguments.
Definition at line 94 of file Builders.h.
References context.
Referenced by convertContractOp(), mlir::createGpuAsyncRegionPass(), mlir::bufferization::eliminateEmptyTensors(), handleInlinedAllocas(), AvgPool2dAdaptiveToAvgPool2d::matchAndRewrite(), ConcatSliceOptimization::matchAndRewrite(), FoldTensorCastProducerOp::matchAndRewrite(), MaxPool2dAdaptiveToMaxPool2d::matchAndRewrite(), SelectToExtUI::matchAndRewrite(), SliceDynamicSizeCanonicalization::matchAndRewrite(), SwapExtractSliceOfFill::matchAndRewrite(), WrapFuncInClass::matchAndRewrite(), parseAsyncDependencies(), parseResultsValueType(), propagateSubViewOp(), reduceMatchAndRewriteHelper(), mlir::tensor::replaceExtractSliceWithTiledProducer(), and replaceUsesAndPropagateType().
Definition at line 321 of file Builders.cpp.
References getArrayAttr().
| IntegerAttr Builder::getUI32IntegerAttr | ( | uint32_t | value | ) |
Definition at line 220 of file Builders.cpp.
References getIntegerType().
| UnitAttr Builder::getUnitAttr | ( | ) |
Definition at line 106 of file Builders.cpp.
References context.
Referenced by mlir::GPUFuncOpLowering::buildLoweredGPULLVMFuncAttrs(), buildQuantifier(), mlir::detail::ConversionPatternRewriterImpl::buildUnresolvedMaterialization(), mlir::amdgpu::impl::AmdgpuMaskedloadToLoadPassBase< DerivedT >::classof(), convertTransferReadOp(), mlir::nvgpu::createAsyncGroups(), getLaneId(), parseCommonGlobalAndAlias(), parseCreateOperationOpResults(), and mlir::transform::parseTransformMatchDims().
| Location Builder::getUnknownLoc | ( | ) |
Definition at line 25 of file Builders.cpp.
References context.
Referenced by mlir::tosa::buildQTypeFromMinMax(), fillStructuredOpRegion(), and mlir::tileAndFuseConsumerOfSlices().
| TypedAttr Builder::getZeroAttr | ( | Type | type | ) |
Definition at line 333 of file Builders.cpp.
References mlir::DenseElementsAttr::get(), getFloatAttr(), getIndexAttr(), getIntegerAttr(), and getZeroAttr().
Referenced by mlir::sparse_tensor::Merger::buildExp(), mlir::sparse_tensor::buildRelu(), mlir::sparse_tensor::constantOne(), mlir::sparse_tensor::constantZero(), createNonLdMatrixLoads(), mlir::xegpu::createReductionNeutralValue(), mlir::xegpu::createVectorWithShapeFromValues(), delinearizeInductionVariable(), mlir::emitNormalizedLoopBounds(), mlir::arith::getIdentityValueAttr(), getZeroAttr(), mlir::arith::getZeroConstant(), handleMultidimensionalVectors(), mlir::affine::lowerAffineDelinearizeIndexOp(), mlir::affine::lowerAffineLinearizeIndexOp(), mlir::xegpu::lowerCrossLaneReductionToShuffles(), mlir::linalg::lowerPack(), mlir::xegpu::lowerToVectorReductions(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), Convert1DExtractStridedSliceIntoExtractInsertChain::matchAndRewrite(), DecomposeNDExtractStridedSlice::matchAndRewrite(), OuterProductOpLowering::matchAndRewrite(), TransposeOpLowering::matchAndRewrite(), mlir::linalg::pack(), reshapeLoad(), mlir::linalg::rewriteAsPaddedOp(), mlir::linalg::rewriteAsPaddedOp(), and vectorizeTensorExtract().
|
protected |
Definition at line 205 of file Builders.h.
Referenced by Builder(), mlir::ImplicitLocOpBuilder::create(), getAffineConstantExpr(), getAffineDimExpr(), getAffineSymbolExpr(), getArrayAttr(), getAttr(), getBF16Type(), getBoolAttr(), getContext(), getDenseBoolArrayAttr(), getDenseF32ArrayAttr(), getDenseF64ArrayAttr(), getDenseI16ArrayAttr(), getDenseI32ArrayAttr(), getDenseI64ArrayAttr(), getDenseI8ArrayAttr(), getDictionaryAttr(), getEmptyAffineMap(), getF128Type(), getF16Type(), getF32Type(), getF64Type(), getF80Type(), getF8E4M3FNType(), getF8E5M2Type(), getF8E5M3FNUType(), getF8E8M0Type(), getFunctionType(), getFusedLoc(), getGraphType(), getI16Type(), getI1Type(), getI2Type(), getI32Type(), getI4Type(), getI64Type(), getI8Type(), getIndexType(), getIntegerType(), getIntegerType(), getMultiDimIdentityMap(), getNoneType(), getShiftedAffineMap(), getStringAttr(), getTF32Type(), getTupleType(), getType(), getUnitAttr(), getUnknownLoc(), and mlir::detail::ConversionPatternRewriterImpl::SingleEraseRewriter::SingleEraseRewriter().