#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/Transforms/Passes.h"
#include "mlir/Dialect/SparseTensor/IR/SparseTensor.h"
#include "mlir/Dialect/SparseTensor/Transforms/Passes.h"
namespace mlir {
#define GEN_PASS_DEF_SPARSESPACECOLLAPSE
#include "mlir/Dialect/SparseTensor/Transforms/Passes.h.inc"
}
#define DEBUG_TYPE …
usingnamespacemlir;
usingnamespacesparse_tensor;
namespace {
struct CollapseSpaceInfo { … };
bool isCollapsableLoops(LoopLikeOpInterface parent, LoopLikeOpInterface node) { … }
bool legalToCollapse(SmallVectorImpl<CollapseSpaceInfo> &toCollapse,
ExtractIterSpaceOp curSpace) { … }
void collapseSparseSpace(MutableArrayRef<CollapseSpaceInfo> toCollapse) { … }
struct SparseSpaceCollapsePass
: public impl::SparseSpaceCollapseBase<SparseSpaceCollapsePass> { … };
}
std::unique_ptr<Pass> mlir::createSparseSpaceCollapsePass() { … }