MLIR 24.0.0git
mlir::SaturatedInteger Struct Reference

Idiomatic saturated operations on values like offsets, sizes, and strides. More...

#include "mlir/Dialect/Utils/StaticValueUtils.h"

Public Member Functions

int64_t asInteger ()
bool isSaturated () const
FailureOr< SaturatedIntegerdesaturate (SaturatedInteger other)
bool operator== (SaturatedInteger other)
bool operator!= (SaturatedInteger other)
SaturatedInteger operator+ (SaturatedInteger other)
SaturatedInteger operator* (SaturatedInteger other)
SaturatedInteger smax (SaturatedInteger other)

Static Public Member Functions

static SaturatedInteger wrap (int64_t v)

Public Attributes

bool saturated = true
int64_t v = 0

Detailed Description

Idiomatic saturated operations on values like offsets, sizes, and strides.

Definition at line 244 of file StaticValueUtils.h.

Member Function Documentation

◆ asInteger()

int64_t mlir::SaturatedInteger::asInteger ( )
inline

Definition at line 249 of file StaticValueUtils.h.

References saturated, and v.

◆ desaturate()

FailureOr< SaturatedInteger > mlir::SaturatedInteger::desaturate ( SaturatedInteger other)
inline

Definition at line 251 of file StaticValueUtils.h.

References saturated, and v.

◆ isSaturated()

bool mlir::SaturatedInteger::isSaturated ( ) const
inline

Definition at line 250 of file StaticValueUtils.h.

References saturated.

◆ operator!=()

bool mlir::SaturatedInteger::operator!= ( SaturatedInteger other)
inline

Definition at line 262 of file StaticValueUtils.h.

◆ operator*()

SaturatedInteger mlir::SaturatedInteger::operator* ( SaturatedInteger other)
inline

Definition at line 268 of file StaticValueUtils.h.

References saturated, and v.

◆ operator+()

SaturatedInteger mlir::SaturatedInteger::operator+ ( SaturatedInteger other)
inline

Definition at line 263 of file StaticValueUtils.h.

References saturated, and v.

◆ operator==()

bool mlir::SaturatedInteger::operator== ( SaturatedInteger other)
inline

Definition at line 258 of file StaticValueUtils.h.

References saturated, and v.

◆ smax()

SaturatedInteger mlir::SaturatedInteger::smax ( SaturatedInteger other)
inline

Definition at line 279 of file StaticValueUtils.h.

References saturated, and v.

◆ wrap()

SaturatedInteger mlir::SaturatedInteger::wrap ( int64_t v)
inlinestatic

Definition at line 245 of file StaticValueUtils.h.

References v.

Referenced by computeCollapsedLayoutMap(), and computeExpandedLayoutMap().

Member Data Documentation

◆ saturated

bool mlir::SaturatedInteger::saturated = true

◆ v

int64_t mlir::SaturatedInteger::v = 0

Definition at line 285 of file StaticValueUtils.h.

Referenced by asInteger(), desaturate(), operator*(), operator+(), operator==(), smax(), and wrap().


The documentation for this struct was generated from the following file: