aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp
diff options
context:
space:
mode:
authorTom Eccles <tom.eccles@arm.com>2024-05-23 12:12:22 +0100
committerGitHub <noreply@github.com>2024-05-23 12:12:22 +0100
commit55e5842385ef18eaf7b5b6548413f4ee6f555dfc (patch)
tree5d169b2c326bca4aeb7e3e7952e4ab3330be0d05 /mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp
parent1d0e8b24001d854a848a3810b90244a6bc94cf03 (diff)
downloadllvm-55e5842385ef18eaf7b5b6548413f4ee6f555dfc.zip
llvm-55e5842385ef18eaf7b5b6548413f4ee6f555dfc.tar.gz
llvm-55e5842385ef18eaf7b5b6548413f4ee6f555dfc.tar.bz2
[mlir][OpenMP] Remove deprecated omp.reduction (#92732)
This operation did not model the behaviour of reductions in the openmp standard. It has since been replaced by block arguments on the outer operation. See https://github.com/llvm/llvm-project/pull/79308 and https://github.com/llvm/llvm-project/pull/80019
Diffstat (limited to 'mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp')
-rw-r--r--mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp b/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp
index a206c7b..f6a6d1d 100644
--- a/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp
+++ b/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp
@@ -185,21 +185,6 @@ struct MapInfoOpConversion : public ConvertOpToLLVMPattern<omp::MapInfoOp> {
}
};
-struct ReductionOpConversion : public ConvertOpToLLVMPattern<omp::ReductionOp> {
- using ConvertOpToLLVMPattern<omp::ReductionOp>::ConvertOpToLLVMPattern;
- LogicalResult
- matchAndRewrite(omp::ReductionOp curOp, OpAdaptor adaptor,
- ConversionPatternRewriter &rewriter) const override {
- if (isa<MemRefType>(curOp.getAccumulator().getType())) {
- // TODO: Support memref type in variable operands
- return rewriter.notifyMatchFailure(curOp, "memref is not supported yet");
- }
- rewriter.replaceOpWithNewOp<omp::ReductionOp>(
- curOp, TypeRange(), adaptor.getOperands(), curOp->getAttrs());
- return success();
- }
-};
-
template <typename OpType>
struct MultiRegionOpConversion : public ConvertOpToLLVMPattern<OpType> {
using ConvertOpToLLVMPattern<OpType>::ConvertOpToLLVMPattern;
@@ -246,9 +231,6 @@ void mlir::configureOpenMPToLLVMConversionLegality(
return typeConverter.isLegal(op->getOperandTypes()) &&
typeConverter.isLegal(op->getResultTypes());
});
- target.addDynamicallyLegalOp<mlir::omp::ReductionOp>([&](Operation *op) {
- return typeConverter.isLegal(op->getOperandTypes());
- });
target.addDynamicallyLegalOp<
mlir::omp::AtomicUpdateOp, mlir::omp::CriticalOp, mlir::omp::TargetOp,
mlir::omp::TargetDataOp, mlir::omp::LoopNestOp,
@@ -275,11 +257,11 @@ void mlir::populateOpenMPToLLVMConversionPatterns(LLVMTypeConverter &converter,
[&](omp::MapBoundsType type) -> Type { return type; });
patterns.add<
- AtomicReadOpConversion, MapInfoOpConversion, ReductionOpConversion,
+ AtomicReadOpConversion, MapInfoOpConversion,
MultiRegionOpConversion<omp::DeclareReductionOp>,
MultiRegionOpConversion<omp::PrivateClauseOp>,
RegionOpConversion<omp::CriticalOp>, RegionOpConversion<omp::LoopNestOp>,
- RegionOpConversion<omp::MasterOp>, ReductionOpConversion,
+ RegionOpConversion<omp::MasterOp>,
RegionOpConversion<omp::OrderedRegionOp>,
RegionOpConversion<omp::ParallelOp>, RegionOpConversion<omp::WsloopOp>,
RegionOpConversion<omp::SectionsOp>, RegionOpConversion<omp::SectionOp>,