MLIR  16.0.0git
Public Types | Public Member Functions | List of all members
mlir::FusionStrategy Class Reference

Describes the fusion strategy to be used in the Affine loop fusion utilities. More...

#include "mlir/Dialect/Affine/LoopFusionUtils.h"

Public Types

enum  StrategyEnum { Generic, ProducerConsumer, Sibling }
 

Public Member Functions

 FusionStrategy (StrategyEnum strategy)
 Construct a generic or producer-consumer fusion strategy. More...
 
 FusionStrategy (Value memref)
 Construct a sibling fusion strategy targeting 'memref'. More...
 
StrategyEnum getStrategy () const
 Returns the fusion strategy. More...
 
Value getSiblingFusionMemRef () const
 Returns the memref attached to this sibling fusion strategy. More...
 

Detailed Description

Describes the fusion strategy to be used in the Affine loop fusion utilities.

Currently, it is used to specialized the loop fusion utilities with the assumptions made in the AffineLoopFusion pass for producer-consumer and sibling fusion, while sharing a single implementation. The latter strategies are also limited to scenarios where a single memref is involved in the producer-consume or sibling relationship between the candidate loops. We use 'memref' to keep track of such a memref.

Definition at line 54 of file LoopFusionUtils.h.

Member Enumeration Documentation

◆ StrategyEnum

Enumerator
Generic 
ProducerConsumer 
Sibling 

Definition at line 56 of file LoopFusionUtils.h.

Constructor & Destructor Documentation

◆ FusionStrategy() [1/2]

mlir::FusionStrategy::FusionStrategy ( StrategyEnum  strategy)
inline

Construct a generic or producer-consumer fusion strategy.

Definition at line 77 of file LoopFusionUtils.h.

References mlir::Sibling.

◆ FusionStrategy() [2/2]

mlir::FusionStrategy::FusionStrategy ( Value  memref)
inline

Construct a sibling fusion strategy targeting 'memref'.

This construct should only be used for sibling fusion.

Definition at line 84 of file LoopFusionUtils.h.

Member Function Documentation

◆ getSiblingFusionMemRef()

Value mlir::FusionStrategy::getSiblingFusionMemRef ( ) const
inline

Returns the memref attached to this sibling fusion strategy.

Definition at line 90 of file LoopFusionUtils.h.

References mlir::canFuseLoops(), mlir::fuseLoops(), Generic, and mlir::Sibling.

Referenced by mlir::canFuseLoops().

◆ getStrategy()

StrategyEnum mlir::FusionStrategy::getStrategy ( ) const
inline

Returns the fusion strategy.

Definition at line 87 of file LoopFusionUtils.h.

Referenced by mlir::canFuseLoops().


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