MLIR
18.0.0git
|
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/Dialect/Vector/Transforms/VectorDistribution.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Transforms/RegionUtils.h"
#include "llvm/ADT/SetVector.h"
#include <numeric>
#include <utility>
Go to the source code of this file.
Functions | |
static AffineMap | calculateImplicitMap (VectorType sequentialType, VectorType distributedType) |
Currently the distribution map is implicit based on the vector shape. More... | |
static WarpExecuteOnLane0Op | moveRegionToNewWarpOpAndReplaceReturns (RewriterBase &rewriter, WarpExecuteOnLane0Op warpOp, ValueRange newYieldedValues, TypeRange newReturnTypes) |
Helper to create a new WarpExecuteOnLane0Op with different signature. More... | |
static WarpExecuteOnLane0Op | moveRegionToNewWarpOpAndAppendReturns (RewriterBase &rewriter, WarpExecuteOnLane0Op warpOp, ValueRange newYieldedValues, TypeRange newReturnTypes, llvm::SmallVector< size_t > &indices) |
Helper to create a new WarpExecuteOnLane0Op region with extra outputs. More... | |
static bool | canBeHoisted (Operation *op, function_ref< bool(Value)> definedOutside) |
Helper to know if an op can be hoisted out of the region. More... | |
static OpOperand * | getWarpResult (WarpExecuteOnLane0Op warpOp, const std::function< bool(Operation *)> &fn) |
Return a value yielded by warpOp which statifies the filter lamdba condition and is not dead. More... | |
static Operation * | cloneOpWithOperandsAndTypes (RewriterBase &rewriter, Location loc, Operation *op, ArrayRef< Value > operands, ArrayRef< Type > resultTypes) |
|
static |
Currently the distribution map is implicit based on the vector shape.
In the future it will be part of the op. Example:
Would have an implicit map of: (d0, d1, d2) -> (d0, d2)
Definition at line 36 of file VectorDistribute.cpp.
References mlir::AffineMap::get(), and mlir::getAffineDimExpr().
|
static |
Helper to know if an op can be hoisted out of the region.
Definition at line 225 of file VectorDistribute.cpp.
|
static |
Definition at line 250 of file VectorDistribute.cpp.
|
static |
Return a value yielded by warpOp
which statifies the filter lamdba condition and is not dead.
Definition at line 233 of file VectorDistribute.cpp.
References mlir::Value::getDefiningOp().
|
static |
Helper to create a new WarpExecuteOnLane0Op region with extra outputs.
indices
return the index of each new output.
Definition at line 191 of file VectorDistribute.cpp.
References mlir::detail::enumerate(), moveRegionToNewWarpOpAndReplaceReturns(), and mlir::RewriterBase::replaceOp().
|
static |
Helper to create a new WarpExecuteOnLane0Op with different signature.
Definition at line 163 of file VectorDistribute.cpp.
References mlir::Region::begin(), mlir::OpBuilder::create(), mlir::RewriterBase::eraseBlock(), mlir::Region::front(), mlir::Region::getBlocks(), mlir::RewriterBase::inlineRegionBefore(), mlir::OpBuilder::setInsertionPoint(), and mlir::RewriterBase::updateRootInPlace().
Referenced by moveRegionToNewWarpOpAndAppendReturns().