MLIR  15.0.0git
Classes | Functions
mlir::arith Namespace Reference

Classes

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  ConstantIntOp
 Specialization of arith.constant op that returns an integer value. More...
 

Functions

void populateArithmeticToLLVMConversionPatterns (LLVMTypeConverter &converter, RewritePatternSet &patterns)
 
std::unique_ptr< PasscreateConvertArithmeticToLLVMPass ()
 
void populateArithmeticToSPIRVPatterns (SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
 
std::unique_ptr< PasscreateConvertArithmeticToSPIRVPass ()
 
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...
 
Attribute 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 registerBufferizableOpInterfaceExternalModels (DialectRegistry &registry)
 
std::unique_ptr< PasscreateArithmeticBufferizePass ()
 Create a pass to bufferize Arithmetic ops. More...
 
std::unique_ptr< PasscreateConstantBufferizePass (uint64_t alignment=0)
 Create a pass to bufferize arith.constant ops. More...
 
void populateArithmeticExpandOpsPatterns (RewritePatternSet &patterns)
 Add patterns to expand Arithmetic ops for LLVM lowering. More...
 
std::unique_ptr< PasscreateArithmeticExpandOpsPass ()
 Create a pass to legalize Arithmetic ops for LLVM lowering. More...
 

Function Documentation

◆ applyCmpPredicate() [1/2]

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 1234 of file ArithmeticOps.cpp.

Referenced by mlir::arith::ConstantIndexOp::value().

◆ applyCmpPredicate() [2/2]

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 1332 of file ArithmeticOps.cpp.

◆ createArithmeticBufferizePass()

std::unique_ptr< Pass > mlir::arith::createArithmeticBufferizePass ( )

Create a pass to bufferize Arithmetic ops.

Definition at line 56 of file Bufferize.cpp.

◆ createArithmeticExpandOpsPass()

std::unique_ptr< Pass > mlir::arith::createArithmeticExpandOpsPass ( )

Create a pass to legalize Arithmetic ops for LLVM lowering.

Definition at line 238 of file ExpandOps.cpp.

◆ createConstantBufferizePass()

std::unique_ptr< Pass > mlir::arith::createConstantBufferizePass ( uint64_t  alignment = 0)

Create a pass to bufferize arith.constant ops.

Definition at line 61 of file Bufferize.cpp.

Referenced by mlir::sparse_tensor::buildSparseCompiler().

◆ createConvertArithmeticToLLVMPass()

std::unique_ptr< Pass > mlir::arith::createConvertArithmeticToLLVMPass ( )

Definition at line 303 of file ArithmeticToLLVM.cpp.

◆ createConvertArithmeticToSPIRVPass()

std::unique_ptr< Pass > mlir::arith::createConvertArithmeticToSPIRVPass ( )

Definition at line 892 of file ArithmeticToSPIRV.cpp.

◆ getIdentityValue()

Value mlir::arith::getIdentityValue ( AtomicRMWKind  op,
Type  resultType,
OpBuilder builder,
Location  loc 
)

Returns the identity value associated with an AtomicRMWKind op.

Definition at line 1950 of file ArithmeticOps.cpp.

References mlir::OpBuilder::create(), and getIdentityValueAttr().

Referenced by mlir::lowerAffineLowerBound().

◆ getIdentityValueAttr()

Attribute mlir::arith::getIdentityValueAttr ( AtomicRMWKind  kind,
Type  resultType,
OpBuilder builder,
Location  loc 
)

Returns the identity value attribute associated with an AtomicRMWKind op.

Definition at line 1903 of file ArithmeticOps.cpp.

Referenced by createInitialVector(), getIdentityValue(), and isNeutralElementConst().

◆ getReductionOp()

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 1958 of file ArithmeticOps.cpp.

Referenced by mlir::lowerAffineLowerBound().

◆ invertPredicate()

arith::CmpIPredicate mlir::arith::invertPredicate ( arith::CmpIPredicate  pred)

Invert an integer comparison predicate.

Definition at line 44 of file ArithmeticOps.cpp.

Referenced by mlir::scf::getParallelForInductionVarOwner(), and invertPredicate().

◆ populateArithmeticExpandOpsPatterns()

void mlir::arith::populateArithmeticExpandOpsPatterns ( RewritePatternSet patterns)

Add patterns to expand Arithmetic ops for LLVM lowering.

Definition at line 221 of file ExpandOps.cpp.

References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().

◆ populateArithmeticToLLVMConversionPatterns()

void mlir::arith::populateArithmeticToLLVMConversionPatterns ( LLVMTypeConverter converter,
RewritePatternSet patterns 
)

◆ populateArithmeticToSPIRVPatterns()

void mlir::arith::populateArithmeticToSPIRVPatterns ( SPIRVTypeConverter typeConverter,
RewritePatternSet patterns 
)

◆ registerBufferizableOpInterfaceExternalModels()

void mlir::arith::registerBufferizableOpInterfaceExternalModels ( DialectRegistry registry)