MLIR
17.0.0git
|
Classes | |
class | AttrConvertFastMathToLLVM |
class | ConstantIntOp |
Specialization of arith.constant op that returns an integer value. More... | |
class | ConstantFloatOp |
Specialization of arith.constant op that returns a floating point value. More... | |
class | ConstantIndexOp |
Specialization of arith.constant op that returns an integer of index type. More... | |
class | WideIntEmulationConverter |
Converts integer types that are too wide for the target by splitting them in two halves and thus turning into supported ones, i.e., i2*N --> iN, where N is the widest integer bitwidth supported by the target. More... | |
Functions | |
LLVM::FastmathFlags | convertArithFastMathFlagsToLLVM (arith::FastMathFlags arithFMF) |
LLVM::FastmathFlagsAttr | convertArithFastMathAttrToLLVM (arith::FastMathFlagsAttr fmfAttr) |
void | populateArithToLLVMConversionPatterns (LLVMTypeConverter &converter, RewritePatternSet &patterns) |
void | populateArithToSPIRVPatterns (SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns) |
std::unique_ptr< OperationPass<> > | createConvertArithToSPIRVPass () |
bool | applyCmpPredicate (arith::CmpIPredicate predicate, const APInt &lhs, const APInt &rhs) |
Compute lhs pred rhs , where pred is one of the known integer comparison predicates. More... | |
bool | applyCmpPredicate (arith::CmpFPredicate predicate, const APFloat &lhs, const APFloat &rhs) |
Compute lhs pred rhs , where pred is one of the known floating point comparison predicates. More... | |
TypedAttr | getIdentityValueAttr (AtomicRMWKind kind, Type resultType, OpBuilder &builder, Location loc) |
Returns the identity value attribute associated with an AtomicRMWKind op. More... | |
Value | getIdentityValue (AtomicRMWKind op, Type resultType, OpBuilder &builder, Location loc) |
Returns the identity value associated with an AtomicRMWKind op. More... | |
Value | getReductionOp (AtomicRMWKind op, OpBuilder &builder, Location loc, Value lhs, Value rhs) |
Returns the value obtained by applying the reduction operation kind associated with a binary AtomicRMWKind op to lhs and rhs . More... | |
arith::CmpIPredicate | invertPredicate (arith::CmpIPredicate pred) |
Invert an integer comparison predicate. More... | |
void | registerValueBoundsOpInterfaceExternalModels (DialectRegistry ®istry) |
void | registerBufferizableOpInterfaceExternalModels (DialectRegistry ®istry) |
std::unique_ptr< Pass > | createArithBufferizePass () |
Create a pass to bufferize Arith ops. More... | |
std::unique_ptr< Pass > | createConstantBufferizePass (uint64_t alignment=0) |
Create a pass to bufferize arith.constant ops. More... | |
void | populateArithWideIntEmulationPatterns (WideIntEmulationConverter &typeConverter, RewritePatternSet &patterns) |
Adds patterns to emulate wide Arith and Function ops over integer types into supported ones. More... | |
void | populateCeilFloorDivExpandOpsPatterns (RewritePatternSet &patterns) |
Add patterns to expand Arith ceil/floor division ops. More... | |
void | populateExpandBFloat16Patterns (RewritePatternSet &patterns) |
Add patterns to expand Arith bf16 patterns to lower level bitcasts/shifts. More... | |
void | populateArithExpandOpsPatterns (RewritePatternSet &patterns) |
Add patterns to expand Arith ops. More... | |
std::unique_ptr< Pass > | createArithExpandOpsPass () |
Create a pass to legalize Arith ops. More... | |
std::unique_ptr< Pass > | createArithExpandOpsPass (const ArithExpandOpsOptions &options) |
Create a pass to legalize Arith ops with specified configuration. More... | |
std::unique_ptr< Pass > | createArithUnsignedWhenEquivalentPass () |
Create a pass to replace signed ops with unsigned ones where they are proven equivalent. More... | |
void | populateIntRangeOptimizationsPatterns (RewritePatternSet &patterns, DataFlowSolver &solver) |
Add patterns for int range based optimizations. More... | |
std::unique_ptr< Pass > | createIntRangeOptimizationsPass () |
Create a pass which do optimizations based on integer range analysis. More... | |
void | populateArithIntNarrowingPatterns (RewritePatternSet &patterns, const ArithIntNarrowingOptions &options) |
Add patterns for integer bitwidth narrowing. More... | |
FailureOr< OpFoldResult > | reifyIndexValueBound (OpBuilder &b, Location loc, presburger::BoundType type, Value value, ValueBoundsConstraintSet::StopConditionFn stopCondition=nullptr, bool closedUB=false) |
Reify a bound for the given index-typed value in terms of SSA values for which stopCondition is met. More... | |
FailureOr< OpFoldResult > | reifyShapedValueDimBound (OpBuilder &b, Location loc, presburger::BoundType type, Value value, int64_t dim, ValueBoundsConstraintSet::StopConditionFn stopCondition=nullptr, bool closedUB=false) |
Reify a bound for the specified dimension of the given shaped value in terms of SSA values for which stopCondition is met. More... | |
bool mlir::arith::applyCmpPredicate | ( | arith::CmpFPredicate | predicate, |
const APFloat & | lhs, | ||
const APFloat & | rhs | ||
) |
Compute lhs
pred
rhs
, where pred
is one of the known floating point comparison predicates.
Definition at line 1728 of file ArithOps.cpp.
bool mlir::arith::applyCmpPredicate | ( | arith::CmpIPredicate | predicate, |
const APInt & | lhs, | ||
const APInt & | rhs | ||
) |
Compute lhs
pred
rhs
, where pred
is one of the known integer comparison predicates.
Definition at line 1589 of file ArithOps.cpp.
LLVM::FastmathFlagsAttr mlir::arith::convertArithFastMathAttrToLLVM | ( | arith::FastMathFlagsAttr | fmfAttr | ) |
Definition at line 34 of file AttrToLLVMConverter.cpp.
References convertArithFastMathFlagsToLLVM(), and mlir::get().
Referenced by mlir::arith::AttrConvertFastMathToLLVM< SourceOp, TargetOp >::AttrConvertFastMathToLLVM().
LLVM::FastmathFlags mlir::arith::convertArithFastMathFlagsToLLVM | ( | arith::FastMathFlags | arithFMF | ) |
Definition at line 15 of file AttrToLLVMConverter.cpp.
References contract().
Referenced by convertArithFastMathAttrToLLVM().
std::unique_ptr< Pass > mlir::arith::createArithBufferizePass | ( | ) |
Create a pass to bufferize Arith ops.
Definition at line 61 of file Bufferize.cpp.
std::unique_ptr< Pass > mlir::arith::createArithExpandOpsPass | ( | ) |
Create a pass to legalize Arith ops.
Definition at line 376 of file ExpandOps.cpp.
Referenced by mlir::sparse_tensor::buildSparseCompiler().
std::unique_ptr< Pass > mlir::arith::createArithExpandOpsPass | ( | const ArithExpandOpsOptions & | options | ) |
Create a pass to legalize Arith ops with specified configuration.
Definition at line 380 of file ExpandOps.cpp.
References options.
std::unique_ptr< Pass > mlir::arith::createArithUnsignedWhenEquivalentPass | ( | ) |
Create a pass to replace signed ops with unsigned ones where they are proven equivalent.
Definition at line 156 of file UnsignedWhenEquivalent.cpp.
std::unique_ptr< Pass > mlir::arith::createConstantBufferizePass | ( | uint64_t | alignment = 0 | ) |
Create a pass to bufferize arith.constant ops.
Definition at line 66 of file Bufferize.cpp.
std::unique_ptr< OperationPass<> > mlir::arith::createConvertArithToSPIRVPass | ( | ) |
Definition at line 1179 of file ArithToSPIRV.cpp.
std::unique_ptr< Pass > mlir::arith::createIntRangeOptimizationsPass | ( | ) |
Create a pass which do optimizations based on integer range analysis.
Definition at line 184 of file IntRangeOptimizations.cpp.
Value mlir::arith::getIdentityValue | ( | AtomicRMWKind | op, |
Type | resultType, | ||
OpBuilder & | builder, | ||
Location | loc | ||
) |
Returns the identity value associated with an AtomicRMWKind op.
Definition at line 2381 of file ArithOps.cpp.
TypedAttr mlir::arith::getIdentityValueAttr | ( | AtomicRMWKind | kind, |
Type | resultType, | ||
OpBuilder & | builder, | ||
Location | loc | ||
) |
Returns the identity value attribute associated with an AtomicRMWKind op.
Definition at line 2334 of file ArithOps.cpp.
Referenced by createInitialVector(), and isNeutralElementConst().
Value mlir::arith::getReductionOp | ( | AtomicRMWKind | op, |
OpBuilder & | builder, | ||
Location | loc, | ||
Value | lhs, | ||
Value | rhs | ||
) |
Returns the value obtained by applying the reduction operation kind associated with a binary AtomicRMWKind op to lhs
and rhs
.
Return the value obtained by applying the reduction operation kind associated with a binary AtomicRMWKind op to lhs
and rhs
.
Definition at line 2389 of file ArithOps.cpp.
Referenced by mlir::affine::loopUnrollJamByFactor().
arith::CmpIPredicate mlir::arith::invertPredicate | ( | arith::CmpIPredicate | pred | ) |
Invert an integer comparison predicate.
Definition at line 51 of file ArithOps.cpp.
Referenced by invertPredicate().
void mlir::arith::populateArithExpandOpsPatterns | ( | RewritePatternSet & | patterns | ) |
Add patterns to expand Arith ops.
Definition at line 366 of file ExpandOps.cpp.
References mlir::RewritePatternSet::add(), mlir::RewritePatternSet::getContext(), and populateCeilFloorDivExpandOpsPatterns().
void mlir::arith::populateArithIntNarrowingPatterns | ( | RewritePatternSet & | patterns, |
const ArithIntNarrowingOptions & | options | ||
) |
Add patterns for integer bitwidth narrowing.
Definition at line 766 of file IntNarrowing.cpp.
References mlir::RewritePatternSet::add(), mlir::RewritePatternSet::getContext(), and options.
void mlir::arith::populateArithToLLVMConversionPatterns | ( | LLVMTypeConverter & | converter, |
RewritePatternSet & | patterns | ||
) |
Definition at line 446 of file ArithToLLVM.cpp.
References mlir::RewritePatternSet::add().
void mlir::arith::populateArithToSPIRVPatterns | ( | SPIRVTypeConverter & | typeConverter, |
RewritePatternSet & | patterns | ||
) |
Definition at line 1072 of file ArithToSPIRV.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::arith::populateArithWideIntEmulationPatterns | ( | WideIntEmulationConverter & | typeConverter, |
RewritePatternSet & | patterns | ||
) |
Adds patterns to emulate wide Arith and Function ops over integer types into supported ones.
This is done by splitting original power-of-two i2N integer types into two iN halves.
Definition at line 1153 of file EmulateWideInt.cpp.
References mlir::RewritePatternSet::add(), mlir::RewritePatternSet::getContext(), mlir::populateCallOpTypeConversionPattern(), and mlir::populateReturnOpTypeConversionPattern().
void mlir::arith::populateCeilFloorDivExpandOpsPatterns | ( | RewritePatternSet & | patterns | ) |
Add patterns to expand Arith ceil/floor division ops.
Definition at line 354 of file ExpandOps.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
Referenced by populateArithExpandOpsPatterns().
void mlir::arith::populateExpandBFloat16Patterns | ( | RewritePatternSet & | patterns | ) |
Add patterns to expand Arith bf16 patterns to lower level bitcasts/shifts.
Definition at line 361 of file ExpandOps.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::arith::populateIntRangeOptimizationsPatterns | ( | RewritePatternSet & | patterns, |
DataFlowSolver & | solver | ||
) |
Add patterns for int range based optimizations.
Definition at line 179 of file IntRangeOptimizations.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::arith::registerBufferizableOpInterfaceExternalModels | ( | DialectRegistry & | registry | ) |
Definition at line 197 of file BufferizableOpInterfaceImpl.cpp.
References mlir::DialectRegistry::addExtension().
Referenced by mlir::registerAllDialects().
void mlir::arith::registerValueBoundsOpInterfaceExternalModels | ( | DialectRegistry & | registry | ) |
Definition at line 73 of file ValueBoundsOpInterfaceImpl.cpp.
References mlir::DialectRegistry::addExtension().
Referenced by mlir::registerAllDialects().
FailureOr< OpFoldResult > mlir::arith::reifyIndexValueBound | ( | OpBuilder & | b, |
Location | loc, | ||
presburger::BoundType | type, | ||
Value | value, | ||
ValueBoundsConstraintSet::StopConditionFn | stopCondition = nullptr , |
||
bool | closedUB = false |
||
) |
Reify a bound for the given index-typed value in terms of SSA values for which stopCondition
is met.
If no stop condition is specified, reify in terms of the operands of the owner op.
By default, lower/equal bounds are closed and upper bounds are open. If closedUB
is set to "true", upper bounds are also closed.
Example: %0 = arith.addi a, b : index %1 = arith.addi %0, c : index
stopCondition
evaluates to "true" for %0 and c, "%0 + %c" is an EQ bound for %1.stopCondition
evaluates to "true" for a, b and c, "%a + %b + %c" is an EQ bound for %1.Definition at line 135 of file ReifyValueBounds.cpp.
References reifyValueBound().
FailureOr< OpFoldResult > mlir::arith::reifyShapedValueDimBound | ( | OpBuilder & | b, |
Location | loc, | ||
presburger::BoundType | type, | ||
Value | value, | ||
int64_t | dim, | ||
ValueBoundsConstraintSet::StopConditionFn | stopCondition = nullptr , |
||
bool | closedUB = false |
||
) |
Reify a bound for the specified dimension of the given shaped value in terms of SSA values for which stopCondition
is met.
If no stop condition is specified, reify in terms of the operands of the owner op.
By default, lower/equal bounds are closed and upper bounds are open. If closedUB
is set to "true", upper bounds are also closed.
Definition at line 118 of file ReifyValueBounds.cpp.
References reifyValueBound().