MLIR
20.0.0git
|
#include "SparseTensorIterator.h"
#include "CodegenUtils.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
Go to the source code of this file.
Macros | |
#define | CMPI(p, lhs, rhs) |
#define | C_FALSE (constantI1(b, l, false)) |
#define | C_TRUE (constantI1(b, l, true)) |
#define | C_IDX(v) (constantIndex(b, l, (v))) |
#define | YIELD(vs) (b.create<scf::YieldOp>(l, (vs))) |
#define | ADDI(lhs, rhs) (b.create<arith::AddIOp>(l, (lhs), (rhs)).getResult()) |
#define | ORI(lhs, rhs) (b.create<arith::OrIOp>(l, (lhs), (rhs)).getResult()) |
#define | ANDI(lhs, rhs) (b.create<arith::AndIOp>(l, (lhs), (rhs)).getResult()) |
#define | SUBI(lhs, rhs) (b.create<arith::SubIOp>(l, (lhs), (rhs)).getResult()) |
#define | MULI(lhs, rhs) (b.create<arith::MulIOp>(l, (lhs), (rhs)).getResult()) |
#define | MINUI(lhs, rhs) (b.create<arith::MinUIOp>(l, (lhs), (rhs)).getResult()) |
#define | REMUI(lhs, rhs) (b.create<arith::RemUIOp>(l, (lhs), (rhs)).getResult()) |
#define | DIVUI(lhs, rhs) (b.create<arith::DivUIOp>(l, (lhs), (rhs)).getResult()) |
#define | SELECT(c, lhs, rhs) (b.create<arith::SelectOp>(l, (c), (lhs), (rhs)).getResult()) |
Typedefs | |
using | ValuePair = std::pair< Value, Value > |
using | ValueTuple = std::tuple< Value, Value, Value > |
Functions | |
static scf::ValueVector | genWhenInBound (OpBuilder &b, Location l, SparseIterator &it, ValueRange elseRet, llvm::function_ref< scf::ValueVector(OpBuilder &, Location, Value)> builder) |
static Value | offsetFromMinCrd (OpBuilder &b, Location l, Value minCrd, Value size) |
Generates code to compute the absolute offset of the slice based on the provide minimum coordinates in the slice. More... | |
static const SparseIterator * | tryUnwrapFilter (const SparseIterator *it) |
#define ADDI | ( | lhs, | |
rhs | |||
) | (b.create<arith::AddIOp>(l, (lhs), (rhs)).getResult()) |
Definition at line 32 of file SparseTensorIterator.cpp.
#define ANDI | ( | lhs, | |
rhs | |||
) | (b.create<arith::AndIOp>(l, (lhs), (rhs)).getResult()) |
Definition at line 34 of file SparseTensorIterator.cpp.
#define C_FALSE (constantI1(b, l, false)) |
Definition at line 28 of file SparseTensorIterator.cpp.
#define C_IDX | ( | v | ) | (constantIndex(b, l, (v))) |
Definition at line 30 of file SparseTensorIterator.cpp.
#define C_TRUE (constantI1(b, l, true)) |
Definition at line 29 of file SparseTensorIterator.cpp.
#define CMPI | ( | p, | |
lhs, | |||
rhs | |||
) |
Definition at line 24 of file SparseTensorIterator.cpp.
#define DIVUI | ( | lhs, | |
rhs | |||
) | (b.create<arith::DivUIOp>(l, (lhs), (rhs)).getResult()) |
Definition at line 39 of file SparseTensorIterator.cpp.
#define MINUI | ( | lhs, | |
rhs | |||
) | (b.create<arith::MinUIOp>(l, (lhs), (rhs)).getResult()) |
Definition at line 37 of file SparseTensorIterator.cpp.
#define MULI | ( | lhs, | |
rhs | |||
) | (b.create<arith::MulIOp>(l, (lhs), (rhs)).getResult()) |
Definition at line 36 of file SparseTensorIterator.cpp.
#define ORI | ( | lhs, | |
rhs | |||
) | (b.create<arith::OrIOp>(l, (lhs), (rhs)).getResult()) |
Definition at line 33 of file SparseTensorIterator.cpp.
#define REMUI | ( | lhs, | |
rhs | |||
) | (b.create<arith::RemUIOp>(l, (lhs), (rhs)).getResult()) |
Definition at line 38 of file SparseTensorIterator.cpp.
#define SELECT | ( | c, | |
lhs, | |||
rhs | |||
) | (b.create<arith::SelectOp>(l, (c), (lhs), (rhs)).getResult()) |
Definition at line 40 of file SparseTensorIterator.cpp.
#define SUBI | ( | lhs, | |
rhs | |||
) | (b.create<arith::SubIOp>(l, (lhs), (rhs)).getResult()) |
Definition at line 35 of file SparseTensorIterator.cpp.
#define YIELD | ( | vs | ) | (b.create<scf::YieldOp>(l, (vs))) |
Definition at line 31 of file SparseTensorIterator.cpp.
Definition at line 18 of file SparseTensorIterator.cpp.
using ValueTuple = std::tuple<Value, Value, Value> |
Definition at line 19 of file SparseTensorIterator.cpp.
|
static |
Definition at line 246 of file SparseTensorIterator.cpp.
References mlir::OpBuilder::create(), mlir::sparse_tensor::SparseIterator::deref(), mlir::sparse_tensor::SparseIterator::genNotEnd(), mlir::ValueRange::getTypes(), mlir::OpBuilder::setInsertionPointAfter(), mlir::OpBuilder::setInsertionPointToStart(), and YIELD.
Generates code to compute the absolute offset of the slice based on the provide minimum coordinates in the slice.
E.g., when reducing d0 + d1 + d2, we need two slices to fully reduced the expression, i,e, s1 = slice(T, d0), s2 = slice(s1, d1). The absolute offset is the offset computed relative to the initial tensors T.
When isNonEmpty == true, the computed offset is meaningless and should not be used during runtime, the method generates code to return 0 currently in that case.
offset = minCrd >= size ? minCrd - size + 1 : 0;
Definition at line 276 of file SparseTensorIterator.cpp.
|
static |
Definition at line 1668 of file SparseTensorIterator.cpp.
Referenced by mlir::sparse_tensor::makeNonEmptySubSectIterator(), and mlir::sparse_tensor::makeTraverseSubSectIterator().