Skip to content

Commit

Permalink
[mlir][Func] Delete DecomposeCallGraphTypes.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-springer committed Nov 23, 2024
1 parent 47e321a commit 4e4a5c8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 178 deletions.

This file was deleted.

1 change: 0 additions & 1 deletion mlir/lib/Dialect/Func/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
add_mlir_dialect_library(MLIRFuncTransforms
DecomposeCallGraphTypes.cpp
DuplicateFunctionElimination.cpp
FuncConversions.cpp
OneToNFuncConversions.cpp
Expand Down
136 changes: 0 additions & 136 deletions mlir/lib/Dialect/Func/Transforms/DecomposeCallGraphTypes.cpp

This file was deleted.

8 changes: 3 additions & 5 deletions mlir/lib/Dialect/Func/Transforms/FuncConversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,10 @@ class ReturnOpTypeConversion : public OpConversionPattern<ReturnOp> {
using OpConversionPattern<ReturnOp>::OpConversionPattern;

LogicalResult
matchAndRewrite(ReturnOp op, OpAdaptor adaptor,
matchAndRewrite(ReturnOp op, OneToNOpAdaptor adaptor,
ConversionPatternRewriter &rewriter) const final {
// For a return, all operands go to the results of the parent, so
// rewrite them all.
rewriter.modifyOpInPlace(op,
[&] { op->setOperands(adaptor.getOperands()); });
rewriter.replaceOpWithNewOp<ReturnOp>(op,
flattenValues(adaptor.getOperands()));
return success();
}
};
Expand Down
7 changes: 5 additions & 2 deletions mlir/test/lib/Dialect/Func/TestDecomposeCallGraphTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "TestDialect.h"
#include "TestOps.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Func/Transforms/DecomposeCallGraphTypes.h"
#include "mlir/Dialect/Func/Transforms/FuncConversions.h"
#include "mlir/IR/Builders.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
Expand Down Expand Up @@ -142,7 +142,10 @@ struct TestDecomposeCallGraphTypes
typeConverter.addArgumentMaterialization(buildMakeTupleOp);
typeConverter.addTargetMaterialization(buildDecomposeTuple);

populateDecomposeCallGraphTypesPatterns(context, typeConverter, patterns);
populateFunctionOpInterfaceTypeConversionPattern<func::FuncOp>(
patterns, typeConverter);
populateReturnOpTypeConversionPattern(patterns, typeConverter);
populateCallOpTypeConversionPattern(patterns, typeConverter);

if (failed(applyPartialConversion(module, target, std::move(patterns))))
return signalPassFailure();
Expand Down

0 comments on commit 4e4a5c8

Please sign in to comment.