================ @@ -0,0 +1,104 @@ +//===- DoConcurrentConversion.cpp -- map `DO CONCURRENT` to OpenMP loops --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "flang/Optimizer/Dialect/FIROps.h" +#include "flang/Optimizer/OpenMP/Passes.h" +#include "mlir/Dialect/Func/IR/FuncOps.h" +#include "mlir/Dialect/OpenMP/OpenMPDialect.h" +#include "mlir/IR/Diagnostics.h" +#include "mlir/Pass/Pass.h" +#include "mlir/Transforms/DialectConversion.h" + +#include <memory> +#include <utility> + +namespace flangomp { +#define GEN_PASS_DEF_DOCONCURRENTCONVERSIONPASS +#include "flang/Optimizer/OpenMP/Passes.h.inc" +} // namespace flangomp + +#define DEBUG_TYPE "do-concurrent-conversion" +#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE << "]: ") + +namespace { +class DoConcurrentConversion : public mlir::OpConversionPattern<fir::DoLoopOp> { +public: + using mlir::OpConversionPattern<fir::DoLoopOp>::OpConversionPattern; + + DoConcurrentConversion(mlir::MLIRContext *context, bool mapToDevice, + llvm::DenseSet<fir::DoLoopOp> &concurrentLoopsToSkip) + : OpConversionPattern(context), mapToDevice(mapToDevice), + concurrentLoopsToSkip(concurrentLoopsToSkip) {} + + mlir::LogicalResult + matchAndRewrite(fir::DoLoopOp doLoop, OpAdaptor adaptor, + mlir::ConversionPatternRewriter &rewriter) const override { + return mlir::success(); ---------------- skatrak wrote:
Since this doesn't trigger a compile error and the `DoConcurrentConversionPass` description states that host mapping is already supported, I'd say this PR could be merged after the follow-up was approved, so that both are merged together and we don't end up misleading users. If you prefer to merge this PR as soon as possible, then I think those issues need to be addressed first, to avoid having this pass "pretend" that it's doing something until host mapping support is eventually upstreamed. https://github.com/llvm/llvm-project/pull/126026 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits