/// Add a bufferization state initializer that initializes the specified
/// dialect-specific bufferization state.
- void addDialectStateInitializer(StringRef name, DialectStateInitFn fn);
+ void addDialectStateInitializer(StringRef name, const DialectStateInitFn &fn);
private:
/// Allow a dialect.
FailureOr<TileLoopNest> tileConsumerAndFuseProducers(
OpBuilder &b, LinalgOp consumerOp, ArrayRef<int64_t> tileSizes,
ArrayRef<int64_t> tileInterchange,
- Optional<LinalgLoopDistributionOptions> tileDistribution);
+ const Optional<LinalgLoopDistributionOptions> &tileDistribution);
//===----------------------------------------------------------------------===//
// Generic op region utilities
OpFoldResult arith::ShLIOp::fold(ArrayRef<Attribute> operands) {
// Don't fold if shifting more than the bit width.
bool bounded = false;
- auto result =
- constFoldBinaryOp<IntegerAttr>(operands, [&](APInt a, const APInt &b) {
+ auto result = constFoldBinaryOp<IntegerAttr>(
+ operands, [&](const APInt &a, const APInt &b) {
bounded = b.ule(b.getBitWidth());
return std::move(a).shl(b);
});
return nullptr;
}
-void BufferizationOptions::addDialectStateInitializer(StringRef name,
- DialectStateInitFn fn) {
+void BufferizationOptions::addDialectStateInitializer(
+ StringRef name, const DialectStateInitFn &fn) {
stateInitializers.push_back(
[=](BufferizationState &state) { state.insertDialectState(name, fn()); });
}
const LinalgComprehensiveModuleBufferize &p) = default;
explicit LinalgComprehensiveModuleBufferize(
- AnalysisBufferizationOptions options)
+ const AnalysisBufferizationOptions &options)
: options(options) {}
void runOnOperation() override;
FailureOr<TileLoopNest> mlir::linalg::tileConsumerAndFuseProducers(
OpBuilder &b, LinalgOp consumerOp, ArrayRef<int64_t> tileSizes,
ArrayRef<int64_t> tileInterchange,
- Optional<LinalgLoopDistributionOptions> tileDistribution) {
+ const Optional<LinalgLoopDistributionOptions> &tileDistribution) {
assert(tileSizes.size() == tileInterchange.size() &&
"expect the number of tile sizes and interchange dims to match");
assert(isPermutation(tileInterchange) &&