MLIR  20.0.0git
Public Attributes | List of all members
mlir::affine::VectorizationStrategy Struct Reference

Holds parameters to perform n-D vectorization on a single loop nest. More...

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

Public Attributes

SmallVector< int64_t, 8 > vectorSizes
 
DenseMap< Operation *, unsigned > loopToVectorDim
 
ReductionLoopMap reductionLoops
 

Detailed Description

Holds parameters to perform n-D vectorization on a single loop nest.

For example, for the following loop nest:

func @vec2d(in: memref<64x128x512xf32>, out: memref<64x128x512xf32>) { affine.for i0 = 0 to 64 { affine.for i1 = 0 to 128 { affine.for i2 = 0 to 512 { ld = affine.load in[i0, i1, i2] : memref<64x128x512xf32> affine.store ld, out[i0, i1, i2] : memref<64x128x512xf32> } } } return }

and VectorizationStrategy = 'vectorSizes = {8, 4}', 'loopToVectorDim = {{i1->0}, {i2->1}}', SuperVectorizer will generate:

func @vec2d(arg0: memref<64x128x512xf32>, arg1: memref<64x128x512xf32>) { affine.for arg2 = 0 to 64 { affine.for arg3 = 0 to 128 step 8 { affine.for arg4 = 0 to 512 step 4 { cst = arith.constant 0.000000e+00 : f32 %0 = vector.transfer_read arg0[arg2, arg3, arg4], cst : ... vector.transfer_write %0, arg1[arg2, arg3, arg4] : ... } } } return }

Definition at line 91 of file Utils.h.

Member Data Documentation

◆ loopToVectorDim

DenseMap<Operation *, unsigned> mlir::affine::VectorizationStrategy::loopToVectorDim

Definition at line 98 of file Utils.h.

Referenced by isUniformDefinition(), and vectorizeLoopIfProfitable().

◆ reductionLoops

ReductionLoopMap mlir::affine::VectorizationStrategy::reductionLoops

Definition at line 101 of file Utils.h.

Referenced by vectorizeLoops().

◆ vectorSizes

SmallVector<int64_t, 8> mlir::affine::VectorizationStrategy::vectorSizes

Definition at line 94 of file Utils.h.

Referenced by getVectorType(), vectorizeLoopIfProfitable(), and vectorizeLoops().


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