From 9e0d31af508045dd3041ecd24d2c510486db49a4 Mon Sep 17 00:00:00 2001 From: NiccoloN Date: Thu, 9 Apr 2026 14:27:23 +0200 Subject: [PATCH] automatic code-reformat --- .../ONNXToSpatial/ONNXToSpatialPass.cpp | 4 +- .../Patterns/Math/Elementwise.cpp | 6 +- .../ONNXToSpatial/Patterns/Math/Gemm.cpp | 4 +- .../Patterns/Math/ReduceMean.cpp | 9 ++- .../ONNXToSpatial/Patterns/NN/Softmax.cpp | 30 ++++---- .../ONNXToSpatial/Patterns/Tensor/Concat.cpp | 4 +- .../ONNXToSpatial/Patterns/Tensor/Gather.cpp | 69 ++++++++++--------- .../ONNXToSpatial/Patterns/Tensor/Resize.cpp | 17 ++--- .../ONNXToSpatial/Patterns/Tensor/Split.cpp | 13 ++-- src/PIM/Dialect/Spatial/DCPGraph/Graph.cpp | 2 +- src/PIM/Dialect/Spatial/DCPGraph/Task.cpp | 6 +- src/PIM/Dialect/Spatial/DCPGraph/Task.hpp | 4 +- .../Spatial/DCPGraph/Uniqueworklist.hpp | 9 +-- src/PIM/Dialect/Spatial/DCPGraph/Utils.hpp | 9 +-- .../SpatialBufferizableOpInterface.cpp | 2 +- .../Pim/ConstantFolding/Patterns/Subview.cpp | 3 +- 16 files changed, 88 insertions(+), 103 deletions(-) diff --git a/src/PIM/Conversion/ONNXToSpatial/ONNXToSpatialPass.cpp b/src/PIM/Conversion/ONNXToSpatial/ONNXToSpatialPass.cpp index b495f13..d140ee2 100644 --- a/src/PIM/Conversion/ONNXToSpatial/ONNXToSpatialPass.cpp +++ b/src/PIM/Conversion/ONNXToSpatial/ONNXToSpatialPass.cpp @@ -175,7 +175,7 @@ bool encapsulateConcat(IRRewriter& rewriter, Location loc, Operation* inst) { auto newCompute = spatial::SpatWeightedCompute::create(rewriter, loc, inst->getResultTypes().front(), sources); llvm::SmallVector sourceTypes; llvm::SmallVector sourceLoc; - for (auto source : sources){ + for (auto source : sources) { sourceTypes.push_back(source.getType()); sourceLoc.push_back(loc); } @@ -183,7 +183,7 @@ bool encapsulateConcat(IRRewriter& rewriter, Location loc, Operation* inst) { newCompute.getProperties().setOperandSegmentSizes({(int) 0, (int) sources.size()}); rewriter.setInsertionPointToEnd(BB); IRMapping mapper; - for(auto [source,bbArg] : llvm::zip(sources, BB->getArguments())) + for (auto [source, bbArg] : llvm::zip(sources, BB->getArguments())) mapper.map(source, bbArg); auto newConcat = rewriter.clone(*inst, mapper); spatial::SpatYieldOp::create(rewriter, loc, newConcat->getResult(0)); diff --git a/src/PIM/Conversion/ONNXToSpatial/Patterns/Math/Elementwise.cpp b/src/PIM/Conversion/ONNXToSpatial/Patterns/Math/Elementwise.cpp index 21221e5..35c8e7d 100644 --- a/src/PIM/Conversion/ONNXToSpatial/Patterns/Math/Elementwise.cpp +++ b/src/PIM/Conversion/ONNXToSpatial/Patterns/Math/Elementwise.cpp @@ -92,10 +92,8 @@ static FailureOr materializeBroadcastedConstantTensor(Value value, return arith::ConstantOp::create(rewriter, loc, resultType, broadcastedAttr).getResult(); } -static FailureOr prepareElementwiseOperand(Value value, - RankedTensorType resultType, - ConversionPatternRewriter& rewriter, - Location loc) { +static FailureOr +prepareElementwiseOperand(Value value, RankedTensorType resultType, ConversionPatternRewriter& rewriter, Location loc) { auto valueType = dyn_cast(value.getType()); if (!valueType || !valueType.hasStaticShape()) return failure(); diff --git a/src/PIM/Conversion/ONNXToSpatial/Patterns/Math/Gemm.cpp b/src/PIM/Conversion/ONNXToSpatial/Patterns/Math/Gemm.cpp index 0e87f7a..fe0d1cb 100644 --- a/src/PIM/Conversion/ONNXToSpatial/Patterns/Math/Gemm.cpp +++ b/src/PIM/Conversion/ONNXToSpatial/Patterns/Math/Gemm.cpp @@ -280,8 +280,8 @@ LogicalResult GemvToSpatialCompute::matchAndRewrite(ONNXGemmOp gemmOp, for (size_t aSliceId = 0; aSliceId < aHSlices[coreId].size(); aSliceId++) weights.push_back(bTiles[outSliceId][coreId][aSliceId]); - auto computeOp = - createSpatCompute(rewriter, gemmLoc, currOutHSliceType, weights, aHSlices[coreId], [&](ValueRange aHSlicesArgs) { + auto computeOp = createSpatCompute( + rewriter, gemmLoc, currOutHSliceType, weights, aHSlices[coreId], [&](ValueRange aHSlicesArgs) { SmallVector vmmOutputs; vmmOutputs.reserve(aHSlicesArgs.size()); for (auto [aHSliceId, computeArg] : llvm::enumerate(aHSlicesArgs)) diff --git a/src/PIM/Conversion/ONNXToSpatial/Patterns/Math/ReduceMean.cpp b/src/PIM/Conversion/ONNXToSpatial/Patterns/Math/ReduceMean.cpp index c78e078..a90f107 100644 --- a/src/PIM/Conversion/ONNXToSpatial/Patterns/Math/ReduceMean.cpp +++ b/src/PIM/Conversion/ONNXToSpatial/Patterns/Math/ReduceMean.cpp @@ -71,10 +71,8 @@ static SmallVector buildCollapseReassociation(ArrayRef(rewriter, loc, resultType, {}, ValueRange {input}, [&](Value x) { auto avgOp = spatial::SpatVAvgOp::create(rewriter, loc, resultType, x); @@ -141,7 +139,8 @@ struct ReduceMeanToSpatialCompute : OpConversionPattern { Location loc = reduceMeanOp.getLoc(); RankedTensorType leafType = getAllOnesType(inputType, resultType.getElementType()); - Value reducedKeepdims = buildReduceMeanKeepdims(adaptor.getData(), reducedAxes, /*axis=*/0, leafType, rewriter, loc); + Value reducedKeepdims = + buildReduceMeanKeepdims(adaptor.getData(), reducedAxes, /*axis=*/0, leafType, rewriter, loc); if (reduceMeanOp.getKeepdims() != 0) { rewriter.replaceOp(reduceMeanOp, reducedKeepdims); diff --git a/src/PIM/Conversion/ONNXToSpatial/Patterns/NN/Softmax.cpp b/src/PIM/Conversion/ONNXToSpatial/Patterns/NN/Softmax.cpp index 34ea12d..e141615 100644 --- a/src/PIM/Conversion/ONNXToSpatial/Patterns/NN/Softmax.cpp +++ b/src/PIM/Conversion/ONNXToSpatial/Patterns/NN/Softmax.cpp @@ -24,18 +24,16 @@ static SmallVector permuteShape(ArrayRef shape, ArrayRef(input.getType()); constexpr size_t numInputs = 1; - auto computeOp = createSpatCompute(rewriter, loc, TypeRange {inputType}, {}, ValueRange {input}, [&](Value x) { - auto softmaxOp = spatial::SpatSoftmaxOp::create(rewriter, loc, inputType, x); - spatial::SpatYieldOp::create(rewriter, loc, softmaxOp.getResult()); - }); + auto computeOp = + createSpatCompute(rewriter, loc, TypeRange {inputType}, {}, ValueRange {input}, [&](Value x) { + auto softmaxOp = spatial::SpatSoftmaxOp::create(rewriter, loc, inputType, x); + spatial::SpatYieldOp::create(rewriter, loc, softmaxOp.getResult()); + }); return computeOp.getResult(0); } -static Value buildSoftmax(Value input, - int64_t softmaxAxis, - int64_t axis, - ConversionPatternRewriter& rewriter, - Location loc) { +static Value +buildSoftmax(Value input, int64_t softmaxAxis, int64_t axis, ConversionPatternRewriter& rewriter, Location loc) { auto inputType = cast(input.getType()); if (axis == inputType.getRank()) return createSoftmaxCompute(input, rewriter, loc); @@ -71,7 +69,8 @@ struct SoftmaxToSpatialCompute : OpConversionPattern { Value result; if (axis == inputType.getRank() - 1) { result = buildSoftmax(input, axis, /*axis=*/0, rewriter, softmaxOp.getLoc()); - } else { + } + else { SmallVector permutation; permutation.reserve(inputType.getRank()); for (int64_t dim = 0; dim < inputType.getRank(); ++dim) @@ -85,14 +84,15 @@ struct SoftmaxToSpatialCompute : OpConversionPattern { auto transposedType = RankedTensorType::get( permuteShape(inputType.getShape(), permutation), inputType.getElementType(), inputType.getEncoding()); - auto preTransposeCompute = createSpatCompute<1>( - rewriter, softmaxOp.getLoc(), TypeRange {transposedType}, {}, input, [&](Value x) { - Value transposed = - ONNXTransposeOp::create(rewriter, softmaxOp.getLoc(), transposedType, x, rewriter.getI64ArrayAttr(permutation)); + auto preTransposeCompute = + createSpatCompute<1>(rewriter, softmaxOp.getLoc(), TypeRange {transposedType}, {}, input, [&](Value x) { + Value transposed = ONNXTransposeOp::create( + rewriter, softmaxOp.getLoc(), transposedType, x, rewriter.getI64ArrayAttr(permutation)); spatial::SpatYieldOp::create(rewriter, softmaxOp.getLoc(), transposed); }); Value transposedInput = preTransposeCompute.getResult(0); - Value transposedResult = buildSoftmax(transposedInput, /*softmaxAxis=*/inputType.getRank() - 1, /*axis=*/0, rewriter, softmaxOp.getLoc()); + Value transposedResult = buildSoftmax( + transposedInput, /*softmaxAxis=*/inputType.getRank() - 1, /*axis=*/0, rewriter, softmaxOp.getLoc()); result = ONNXTransposeOp::create( rewriter, softmaxOp.getLoc(), inputType, transposedResult, rewriter.getI64ArrayAttr(inversePermutation)); } diff --git a/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Concat.cpp b/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Concat.cpp index 84271a8..a32c551 100644 --- a/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Concat.cpp +++ b/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Concat.cpp @@ -23,8 +23,6 @@ struct Concat : public OpConversionPattern { } }; -void populateConcatPatterns(RewritePatternSet& patterns, MLIRContext* ctx) { - patterns.insert(ctx); -} +void populateConcatPatterns(RewritePatternSet& patterns, MLIRContext* ctx) { patterns.insert(ctx); } } // namespace onnx_mlir diff --git a/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Gather.cpp b/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Gather.cpp index ef295aa..6605dc1 100644 --- a/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Gather.cpp +++ b/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Gather.cpp @@ -19,11 +19,8 @@ static int64_t normalizeAxis(int64_t axis, int64_t rank) { return axis >= 0 ? ax static int64_t normalizeIndex(int64_t index, int64_t dimSize) { return index >= 0 ? index : dimSize + index; } -static Value extractSliceAt(Value input, - int64_t axis, - int64_t offset, - ConversionPatternRewriter& rewriter, - Location loc) { +static Value +extractSliceAt(Value input, int64_t axis, int64_t offset, ConversionPatternRewriter& rewriter, Location loc) { auto inputType = cast(input.getType()); SmallVector offsets(inputType.getRank(), rewriter.getIndexAttr(0)); SmallVector sizes; @@ -110,34 +107,42 @@ struct Gather : OpConversionPattern { SmallVector flatIndices(indicesAttr.getValues().begin(), indicesAttr.getValues().end()); Location loc = gatherOp.getLoc(); - auto computeOp = createSpatCompute<1>( - rewriter, loc, TypeRange {gatherOp.getResult().getType()}, {}, adaptor.getData(), [&](Value data) -> LogicalResult { - Value result; - if (indicesType.getRank() == 1) { - result = concatGatherSlices(data, axis, flatIndices, axisDim, rewriter, loc); - } else if (indicesType.getRank() == 2) { - int64_t rowCount = indicesType.getShape()[0]; - int64_t rowWidth = indicesType.getShape()[1]; - SmallVector rows; - rows.reserve(rowCount); - for (int64_t row = 0; row < rowCount; ++row) { - ArrayRef rowIndices(flatIndices.data() + row * rowWidth, rowWidth); - Value gatheredRow = concatGatherSlices(data, axis, rowIndices, axisDim, rewriter, loc); - if (!gatheredRow) - return failure(); - rows.push_back(addLeadingGatherDim(gatheredRow, axis, rewriter, loc)); - } - result = - rows.size() == 1 ? rows.front() : tensor::ConcatOp::create(rewriter, loc, /*axis=*/axis, rows).getResult(); - } else { - return failure(); - } + auto computeOp = + createSpatCompute<1>(rewriter, + loc, + TypeRange {gatherOp.getResult().getType()}, + {}, + adaptor.getData(), + [&](Value data) -> LogicalResult { + Value result; + if (indicesType.getRank() == 1) { + result = concatGatherSlices(data, axis, flatIndices, axisDim, rewriter, loc); + } + else if (indicesType.getRank() == 2) { + int64_t rowCount = indicesType.getShape()[0]; + int64_t rowWidth = indicesType.getShape()[1]; + SmallVector rows; + rows.reserve(rowCount); + for (int64_t row = 0; row < rowCount; ++row) { + ArrayRef rowIndices(flatIndices.data() + row * rowWidth, rowWidth); + Value gatheredRow = concatGatherSlices(data, axis, rowIndices, axisDim, rewriter, loc); + if (!gatheredRow) + return failure(); + rows.push_back(addLeadingGatherDim(gatheredRow, axis, rewriter, loc)); + } + result = rows.size() == 1 + ? rows.front() + : tensor::ConcatOp::create(rewriter, loc, /*axis=*/axis, rows).getResult(); + } + else { + return failure(); + } - if (!result) - return failure(); - spatial::SpatYieldOp::create(rewriter, loc, result); - return success(); - }); + if (!result) + return failure(); + spatial::SpatYieldOp::create(rewriter, loc, result); + return success(); + }); if (failed(computeOp)) return failure(); rewriter.replaceOp(gatherOp, computeOp->getResults()); diff --git a/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Resize.cpp b/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Resize.cpp index 53bb2d5..d5e340e 100644 --- a/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Resize.cpp +++ b/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Resize.cpp @@ -15,11 +15,8 @@ using namespace mlir; namespace onnx_mlir { namespace { -static Value extractSliceAt(Value input, - int64_t axis, - int64_t offset, - ConversionPatternRewriter& rewriter, - Location loc) { +static Value +extractSliceAt(Value input, int64_t axis, int64_t offset, ConversionPatternRewriter& rewriter, Location loc) { auto inputType = cast(input.getType()); SmallVector offsets(inputType.getRank(), rewriter.getIndexAttr(0)); SmallVector sizes; @@ -67,8 +64,7 @@ struct Resize : OpConversionPattern { if (!inputType || !resultType || !inputType.hasStaticShape() || !resultType.hasStaticShape()) return failure(); - if (resizeOp.getMode() != "nearest" - || resizeOp.getCoordinateTransformationMode() != "asymmetric" + if (resizeOp.getMode() != "nearest" || resizeOp.getCoordinateTransformationMode() != "asymmetric" || resizeOp.getNearestMode() != "floor") return failure(); @@ -76,9 +72,10 @@ struct Resize : OpConversionPattern { || llvm::any_of(resultType.getShape(), [](int64_t dim) { return dim <= 0; })) return failure(); - auto computeOp = createSpatCompute<1>( - rewriter, resizeOp.getLoc(), TypeRange {resultType}, {}, adaptor.getX(), [&](Value x) { - Value result = buildNearestResize(x, inputType.getShape(), resultType.getShape(), /*axis=*/0, rewriter, resizeOp.getLoc()); + auto computeOp = + createSpatCompute<1>(rewriter, resizeOp.getLoc(), TypeRange {resultType}, {}, adaptor.getX(), [&](Value x) { + Value result = + buildNearestResize(x, inputType.getShape(), resultType.getShape(), /*axis=*/0, rewriter, resizeOp.getLoc()); spatial::SpatYieldOp::create(rewriter, resizeOp.getLoc(), result); }); rewriter.replaceOp(resizeOp, computeOp.getResults()); diff --git a/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Split.cpp b/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Split.cpp index 1196657..8ed7fcd 100644 --- a/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Split.cpp +++ b/src/PIM/Conversion/ONNXToSpatial/Patterns/Tensor/Split.cpp @@ -12,12 +12,8 @@ namespace { static int64_t normalizeAxis(int64_t axis, int64_t rank) { return axis >= 0 ? axis : rank + axis; } -static Value extractSliceAt(Value input, - int64_t axis, - int64_t offset, - int64_t size, - ConversionPatternRewriter& rewriter, - Location loc) { +static Value extractSliceAt( + Value input, int64_t axis, int64_t offset, int64_t size, ConversionPatternRewriter& rewriter, Location loc) { auto inputType = cast(input.getType()); SmallVector offsets(inputType.getRank(), rewriter.getIndexAttr(0)); SmallVector sizes; @@ -33,9 +29,8 @@ static Value extractSliceAt(Value input, struct Split : OpConversionPattern { using OpConversionPattern::OpConversionPattern; - LogicalResult matchAndRewrite(ONNXSplitOp splitOp, - ONNXSplitOpAdaptor adaptor, - ConversionPatternRewriter& rewriter) const override { + LogicalResult + matchAndRewrite(ONNXSplitOp splitOp, ONNXSplitOpAdaptor adaptor, ConversionPatternRewriter& rewriter) const override { auto inputType = dyn_cast(adaptor.getInput().getType()); if (!inputType || !inputType.hasStaticShape()) return failure(); diff --git a/src/PIM/Dialect/Spatial/DCPGraph/Graph.cpp b/src/PIM/Dialect/Spatial/DCPGraph/Graph.cpp index 15325f1..0288b5c 100644 --- a/src/PIM/Dialect/Spatial/DCPGraph/Graph.cpp +++ b/src/PIM/Dialect/Spatial/DCPGraph/Graph.cpp @@ -485,7 +485,7 @@ DCPAnalysisResult GraphDCP::getResult() { size_t i = 0; for (auto node : nodes) { ret.computeToCPUMap[node->getSpatWeightedCompute()] = cpu; - if (i++ == nodes.size() - 1){ + if (i++ == nodes.size() - 1) { ret.isLastComputeOfACpu.insert(node->getSpatWeightedCompute()); ret.cpuToLastComputeMap[cpu] = node->getSpatWeightedCompute(); } diff --git a/src/PIM/Dialect/Spatial/DCPGraph/Task.cpp b/src/PIM/Dialect/Spatial/DCPGraph/Task.cpp index 724475b..d8f0114 100644 --- a/src/PIM/Dialect/Spatial/DCPGraph/Task.cpp +++ b/src/PIM/Dialect/Spatial/DCPGraph/Task.cpp @@ -43,7 +43,5 @@ bool TaskDCP::hasDescendent(TaskDCP* child) { return false; } -//TODO fare qualcosa di sensato -int TaskDCP::computeWeight(GraphDCP* graph, CPU cpu) { - return orig_weight; -} +// TODO fare qualcosa di sensato +int TaskDCP::computeWeight(GraphDCP* graph, CPU cpu) { return orig_weight; } diff --git a/src/PIM/Dialect/Spatial/DCPGraph/Task.hpp b/src/PIM/Dialect/Spatial/DCPGraph/Task.hpp index 748df3f..2368525 100644 --- a/src/PIM/Dialect/Spatial/DCPGraph/Task.hpp +++ b/src/PIM/Dialect/Spatial/DCPGraph/Task.hpp @@ -75,11 +75,11 @@ public: alst = val; } bool hasDescendent(TaskDCP* child); - int64_t Id() const { return (int64_t)spatWeightedCompute.getAsOpaquePointer(); } + int64_t Id() const { return (int64_t) spatWeightedCompute.getAsOpaquePointer(); } bool isCP() const { return alst == aest; } bool isScheduled() const { return scheduledCPU.has_value(); } - onnx_mlir::spatial::SpatWeightedCompute getSpatWeightedCompute(){return spatWeightedCompute;} + onnx_mlir::spatial::SpatWeightedCompute getSpatWeightedCompute() { return spatWeightedCompute; } friend std::optional addEdge(TaskDCP* parent, TaskDCP* child, Weight_t weight); friend void removeEdge(TaskDCP* parent, TaskDCP* child); diff --git a/src/PIM/Dialect/Spatial/DCPGraph/Uniqueworklist.hpp b/src/PIM/Dialect/Spatial/DCPGraph/Uniqueworklist.hpp index 59d6bbe..e24e3a8 100644 --- a/src/PIM/Dialect/Spatial/DCPGraph/Uniqueworklist.hpp +++ b/src/PIM/Dialect/Spatial/DCPGraph/Uniqueworklist.hpp @@ -71,12 +71,7 @@ public: return true; } - auto begin() { - return storage.begin(); - } - - auto end() { - return storage.end(); - } + auto begin() { return storage.begin(); } + auto end() { return storage.end(); } }; diff --git a/src/PIM/Dialect/Spatial/DCPGraph/Utils.hpp b/src/PIM/Dialect/Spatial/DCPGraph/Utils.hpp index 3ca2b95..276e769 100644 --- a/src/PIM/Dialect/Spatial/DCPGraph/Utils.hpp +++ b/src/PIM/Dialect/Spatial/DCPGraph/Utils.hpp @@ -1,7 +1,9 @@ #pragma once #include "mlir/IR/BuiltinTypeInterfaces.h" + #include "llvm/Support/Casting.h" + #include #include #include @@ -50,10 +52,9 @@ inline int64_t getSpatWeightCompute(onnx_mlir::spatial::SpatWeightedCompute spat int64_t tot = 0; for (auto& region : spatWeightedCompute.getBody()) { for (auto& inst : region) { - for(auto result : inst.getResults()){ - if(auto element = llvm::dyn_cast(result.getType())) - tot += onnx_mlir::getSizeInBytes(element); - } + for (auto result : inst.getResults()) + if (auto element = llvm::dyn_cast(result.getType())) + tot += onnx_mlir::getSizeInBytes(element); } } return tot; diff --git a/src/PIM/Dialect/Spatial/Transforms/SpatialBufferizableOpInterface.cpp b/src/PIM/Dialect/Spatial/Transforms/SpatialBufferizableOpInterface.cpp index d81df66..3fa2413 100644 --- a/src/PIM/Dialect/Spatial/Transforms/SpatialBufferizableOpInterface.cpp +++ b/src/PIM/Dialect/Spatial/Transforms/SpatialBufferizableOpInterface.cpp @@ -413,7 +413,7 @@ struct ChannelBroadcastReceiveOpInterface outputTensor, rewriter.getI32IntegerAttr(numElements * elementSize), rewriter.getI32IntegerAttr(srcCoreId.value())) - .getOutput(); + .getOutput(); replaceOpWithBufferizedValues(rewriter, op, newValue); diff --git a/src/PIM/Pass/Pim/ConstantFolding/Patterns/Subview.cpp b/src/PIM/Pass/Pim/ConstantFolding/Patterns/Subview.cpp index 68034a8..5be11b0 100644 --- a/src/PIM/Pass/Pim/ConstantFolding/Patterns/Subview.cpp +++ b/src/PIM/Pass/Pim/ConstantFolding/Patterns/Subview.cpp @@ -243,8 +243,7 @@ void populateConstantFoldingSubviewPatterns(RewritePatternSet& patterns) { patterns.add( - patterns.getContext()); + FoldConstantCoreSubviewPattern>(patterns.getContext()); } } // namespace onnx_mlir