#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Pass/PassManager.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "llvm/ADT/TypeSwitch.h"
usingnamespacemlir;
static void addOperands(Operation *op, SetVector<Value> &operandSet) { … }
template <int limit = 3>
static bool setFusedOpOperandLimit(OpOperand *fusedOperand) { … }
namespace {
struct TestMultiUseProducerFusion : public OpRewritePattern<linalg::GenericOp> { … };
struct TestLinalgElementwiseFusion
: public PassWrapper<TestLinalgElementwiseFusion,
OperationPass<func::FuncOp>> { … };
}
namespace mlir {
namespace test {
void registerTestLinalgElementwiseFusion() { … }
}
}