|
MLIR 24.0.0git
|
Namespaces | |
| namespace | detail |
Typedefs | |
| using | InferRangeFn |
| Function that performs inference on an array of ConstantIntRanges, abstracted away here to permit writing the function that handles both 64- and 32-bit index types. | |
| using | InferIntegerValueRangeFn |
| Function that performs inferrence on an array of IntegerValueRange. | |
| using | InferRangeWithOvfFlagsFn |
| Function that performs inference on an array of ConstantIntRanges while taking special overflow behavior into account. | |
Enumerations | |
| enum class | CmpMode : uint32_t { Both , Signed , Unsigned } |
| enum class | OverflowFlags : uint32_t { None = 0 , Nsw = 1 , Nuw = 2 } |
| enum class | CmpPredicate : uint64_t { eq , ne , slt , sle , sgt , sge , ult , ule , ugt , uge } |
| Copy of the enum from arith and index to allow the common integer range infrastructure to not depend on either dialect. More... | |
Variables | |
| static constexpr unsigned | indexMinWidth = 32 |
| static constexpr unsigned | indexMaxWidth = 64 |
Function that performs inferrence on an array of IntegerValueRange.
Definition at line 34 of file InferIntRangeCommon.h.
Function that performs inference on an array of ConstantIntRanges, abstracted away here to permit writing the function that handles both 64- and 32-bit index types.
Definition at line 30 of file InferIntRangeCommon.h.
Function that performs inference on an array of ConstantIntRanges while taking special overflow behavior into account.
Definition at line 51 of file InferIntRangeCommon.h.
|
strong |
| Enumerator | |
|---|---|
| Both | |
| Signed | |
| Unsigned | |
Definition at line 40 of file InferIntRangeCommon.h.
|
strong |
Copy of the enum from arith and index to allow the common integer range infrastructure to not depend on either dialect.
| Enumerator | |
|---|---|
| eq | |
| ne | |
| slt | |
| sle | |
| sgt | |
| sge | |
| ult | |
| ule | |
| ugt | |
| uge | |
Definition at line 129 of file InferIntRangeCommon.h.
|
strong |
| Enumerator | |
|---|---|
| None | |
| Nsw | |
| Nuw | |
Definition at line 42 of file InferIntRangeCommon.h.
| std::optional< bool > mlir::intrange::evaluatePred | ( | CmpPredicate | pred, |
| const ConstantIntRanges & | lhs, | ||
| const ConstantIntRanges & | rhs ) |
Returns a boolean value if pred is statically true or false for anypossible inputs falling within lhs and rhs, and std::nullopt if the value of the predicate cannot be determined.
Definition at line 745 of file InferIntRangeCommon.cpp.
References invertPredicate(), and isStaticallyTrue().
Referenced by foldCmpOfMaxOrMin().
| ConstantIntRanges mlir::intrange::extRange | ( | const ConstantIntRanges & | range, |
| unsigned | destWidth ) |
Independently zero-extend the unsigned values and sign-extend the signed values in range to destWidth bits, returning the resulting range.
Referenced by inferIndexCast(), and inferIndexOp().
| ConstantIntRanges mlir::intrange::extSIRange | ( | const ConstantIntRanges & | range, |
| unsigned | destWidth ) |
Use the signed values in range to sign-extend it to destWidth.
Definition at line 139 of file InferIntRangeCommon.cpp.
References mlir::ConstantIntRanges::fromSigned(), mlir::ConstantIntRanges::smax(), and mlir::ConstantIntRanges::smin().
Referenced by makeLikeDest().
| ConstantIntRanges mlir::intrange::extUIRange | ( | const ConstantIntRanges & | range, |
| unsigned | destWidth ) |
Use the unsigned values in range to zero-extend it to destWidth.
Definition at line 132 of file InferIntRangeCommon.cpp.
References mlir::ConstantIntRanges::fromUnsigned(), mlir::ConstantIntRanges::umax(), and mlir::ConstantIntRanges::umin().
Referenced by makeLikeDest().
| ConstantIntRanges mlir::intrange::inferAdd | ( | ArrayRef< ConstantIntRanges > | argRanges, |
| OverflowFlags | ovfFlags = OverflowFlags::None ) |
Definition at line 187 of file InferIntRangeCommon.cpp.
References b, computeBoundsBy(), mlir::ConstantIntRanges::intersection(), Nsw, Nuw, and result.
Referenced by inferAffineExpr().
| ConstantIntRanges mlir::intrange::inferAffineExpr | ( | AffineExpr | expr, |
| ArrayRef< ConstantIntRanges > | dimRanges, | ||
| ArrayRef< ConstantIntRanges > | symbolRanges ) |
Infer the integer range for an affine expression given ranges for its dimensions and symbols.
Definition at line 812 of file InferIntRangeCommon.cpp.
References mlir::Add, mlir::CeilDiv, clampToPositive(), mlir::Constant, mlir::ConstantIntRanges::constant(), mlir::DimId, mlir::FloorDiv, mlir::ConstantIntRanges::fromUnsigned(), mlir::AffineExpr::getKind(), indexMaxWidth, inferAdd(), inferAffineExpr(), inferCeilDivS(), inferFloorDivS(), inferMul(), mlir::ConstantIntRanges::maxRange(), mlir::Mod, mlir::Mul, Nsw, and mlir::SymbolId.
Referenced by inferAffineExpr().
| ConstantIntRanges mlir::intrange::inferAnd | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 569 of file InferIntRangeCommon.cpp.
References b, minMaxBy(), and widenBitwiseBounds().
| ConstantIntRanges mlir::intrange::inferCeilDivS | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 386 of file InferIntRangeCommon.cpp.
References mlir::ConstantIntRanges::constant(), mlir::ConstantIntRanges::fromSigned(), inferDivSRange(), and result.
Referenced by inferAffineExpr().
| ConstantIntRanges mlir::intrange::inferCeilDivU | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 322 of file InferIntRangeCommon.cpp.
References inferDivURange(), and result.
| ConstantIntRanges mlir::intrange::inferDivS | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 379 of file InferIntRangeCommon.cpp.
References inferDivSRange(), and result.
| ConstantIntRanges mlir::intrange::inferDivU | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 315 of file InferIntRangeCommon.cpp.
References inferDivURange(), and result.
| ConstantIntRanges mlir::intrange::inferFloorDivS | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 426 of file InferIntRangeCommon.cpp.
References inferDivSRange(), and result.
Referenced by inferAffineExpr().
| ConstantIntRanges mlir::intrange::inferIndexOp | ( | const InferRangeFn & | inferFn, |
| ArrayRef< ConstantIntRanges > | argRanges, | ||
| intrange::CmpMode | mode ) |
Compute inferFn on ranges, whose size should be the index storage bitwidth.
Then, compute the function on argRanges again after truncating the ranges to 32 bits. Finally, if the truncation of the 64-bit result is equal to the 32-bit result, use it (to preserve compatibility with folders and inference precision), and take the union of the results otherwise.
The mode argument specifies if the unsigned, signed, or both results of the inference computation should be used when comparing the results.
Definition at line 85 of file InferIntRangeCommon.cpp.
References Both, extRange(), indexMaxWidth, indexMinWidth, mlir::ConstantIntRanges::rangeUnion(), Signed, mlir::ConstantIntRanges::smax(), mlir::ConstantIntRanges::smin(), truncRange(), mlir::ConstantIntRanges::umax(), mlir::ConstantIntRanges::umin(), and Unsigned.
| ConstantIntRanges mlir::intrange::inferMaxS | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 515 of file InferIntRangeCommon.cpp.
References mlir::ConstantIntRanges::fromSigned().
| ConstantIntRanges mlir::intrange::inferMaxU | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 524 of file InferIntRangeCommon.cpp.
References mlir::ConstantIntRanges::fromUnsigned().
| ConstantIntRanges mlir::intrange::inferMinS | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 533 of file InferIntRangeCommon.cpp.
References mlir::ConstantIntRanges::fromSigned().
| ConstantIntRanges mlir::intrange::inferMinU | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 542 of file InferIntRangeCommon.cpp.
References mlir::ConstantIntRanges::fromUnsigned().
| ConstantIntRanges mlir::intrange::inferMul | ( | ArrayRef< ConstantIntRanges > | argRanges, |
| OverflowFlags | ovfFlags = OverflowFlags::None ) |
Definition at line 252 of file InferIntRangeCommon.cpp.
References b, mlir::ConstantIntRanges::intersection(), minMaxBy(), Nsw, Nuw, and result.
Referenced by inferAffineExpr().
| ConstantIntRanges mlir::intrange::inferOr | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 581 of file InferIntRangeCommon.cpp.
References b, minMaxBy(), and widenBitwiseBounds().
| ConstantIntRanges mlir::intrange::inferRemS | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 447 of file InferIntRangeCommon.cpp.
References mlir::ConstantIntRanges::fromSigned(), mlir::ConstantIntRanges::maxRange(), and ult.
| ConstantIntRanges mlir::intrange::inferRemU | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 484 of file InferIntRangeCommon.cpp.
References mlir::ConstantIntRanges::fromUnsigned(), and ult.
| ConstantIntRanges mlir::intrange::inferShapedDimOpInterface | ( | ShapedDimOpInterface | op, |
| const IntegerValueRange & | maybeDim ) |
Returns the integer range for the result of a ShapedDimOpInterface given the optional inferred ranges for the dimension index maybeDim.
When a dynamic dimension is encountered, returns [0, signed_max(type(result))].
Definition at line 760 of file InferIntRangeCommon.cpp.
References mlir::ConstantIntRanges::constant(), mlir::ConstantIntRanges::fromSigned(), mlir::ConstantIntRanges::getStorageBitwidth(), mlir::IntegerValueRange::getValue(), mlir::IntegerValueRange::isUninitialized(), result, mlir::ConstantIntRanges::smax(), and mlir::ConstantIntRanges::smin().
| ConstantIntRanges mlir::intrange::inferShl | ( | ArrayRef< ConstantIntRanges > | argRanges, |
| OverflowFlags | ovfFlags = OverflowFlags::None ) |
Definition at line 619 of file InferIntRangeCommon.cpp.
References mlir::ConstantIntRanges::intersection(), minMaxBy(), Nsw, Nuw, and result.
| ConstantIntRanges mlir::intrange::inferShrS | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 653 of file InferIntRangeCommon.cpp.
References minMaxBy().
| ConstantIntRanges mlir::intrange::inferShrU | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 665 of file InferIntRangeCommon.cpp.
References minMaxBy().
| ConstantIntRanges mlir::intrange::inferSub | ( | ArrayRef< ConstantIntRanges > | argRanges, |
| OverflowFlags | ovfFlags = OverflowFlags::None ) |
Definition at line 220 of file InferIntRangeCommon.cpp.
References b, computeBoundsBy(), mlir::ConstantIntRanges::intersection(), Nsw, Nuw, and result.
| ConstantIntRanges mlir::intrange::inferXor | ( | ArrayRef< ConstantIntRanges > | argRanges | ) |
Definition at line 603 of file InferIntRangeCommon.cpp.
References mlir::ConstantIntRanges::fromUnsigned(), getVaryingBitsMask(), max(), and min().
| ConstantIntRanges mlir::intrange::truncRange | ( | const ConstantIntRanges & | range, |
| unsigned | destWidth ) |
Truncate range to destWidth bits, taking care to handle cases such as the truncation of [255, 256] to i8 not being a uniform range.
References None.
Referenced by inferIndexOp(), and makeLikeDest().
|
staticconstexpr |
Definition at line 38 of file InferIntRangeCommon.h.
Referenced by inferAffineExpr(), and inferIndexOp().
|
staticconstexpr |
Definition at line 37 of file InferIntRangeCommon.h.
Referenced by inferIndexCast(), and inferIndexOp().