MLIR
22.0.0git
|
#include "mlir/Dialect/Linalg/Passes.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
#include "mlir/Dialect/Linalg/Utils/Utils.h"
#include "mlir/Transforms/DialectConversion.h"
#include "mlir/Dialect/Linalg/Passes.h.inc"
Go to the source code of this file.
Namespaces | |
mlir | |
Include the generated interface declarations. | |
Macros | |
#define | GEN_PASS_DEF_CONVERTELEMENTWISETOLINALGPASS |
Functions | |
static bool | isScalarLike (Type t) |
static bool | isElementwiseMappableOpOnRankedTensors (Operation *op) |
static SmallVector< Value, 4 > | getOrCreateOperandsMatchingResultTypes (OpBuilder &b, Operation *op) |
Given op assumed isElementwiseMappableOpOnRankedTensors , iterate over the result types and return a list of values such that, for each result type t and value v at the same index idx : More... | |
#define GEN_PASS_DEF_CONVERTELEMENTWISETOLINALGPASS |
Definition at line 17 of file ElementwiseToLinalg.cpp.
|
static |
Given op
assumed isElementwiseMappableOpOnRankedTensors
, iterate over the result types and return a list of values such that, for each result type t
and value v
at the same index idx
:
v.getType() == t
op
has type t
, let operand_first
be the first such operand. Thenv == operand_first
.tensor::EmptyOp
with: a. Static and dynamic dims extracted from the first operand of op
. b. Elemental type equal to the elemental type of t
.This is sufficient because ElementwiseMappable guarantees that "The static types of all vector (resp. tensor) operands and results must have the same shape".
Definition at line 59 of file ElementwiseToLinalg.cpp.
References mlir::Operation::getLoc(), mlir::tensor::getMixedSizes(), mlir::Operation::getOperands(), mlir::Operation::getResultTypes(), and isElementwiseMappableOpOnRankedTensors().
|
static |
Definition at line 27 of file ElementwiseToLinalg.cpp.
References mlir::Operation::getOperandTypes(), mlir::OpTrait::hasElementwiseMappableTraits(), and isScalarLike().
Referenced by getOrCreateOperandsMatchingResultTypes().
|
inlinestatic |
Definition at line 23 of file ElementwiseToLinalg.cpp.
Referenced by isElementwiseMappableOpOnRankedTensors().