Skip to content

Commit 726fbc4

Browse files
committed
Handle some more review comments
1 parent fdf7f72 commit 726fbc4

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

flang/lib/Optimizer/OpenMP/DoConcurrentConversion.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,18 @@ class DoConcurrentConversion : public mlir::OpConversionPattern<fir::DoLoopOp> {
3030
public:
3131
using mlir::OpConversionPattern<fir::DoLoopOp>::OpConversionPattern;
3232

33-
DoConcurrentConversion(mlir::MLIRContext *context, bool mapToDevice,
34-
llvm::DenseSet<fir::DoLoopOp> &concurrentLoopsToSkip)
35-
: OpConversionPattern(context), mapToDevice(mapToDevice),
36-
concurrentLoopsToSkip(concurrentLoopsToSkip) {}
33+
DoConcurrentConversion(mlir::MLIRContext *context, bool mapToDevice)
34+
: OpConversionPattern(context), mapToDevice(mapToDevice) {}
3735

3836
mlir::LogicalResult
3937
matchAndRewrite(fir::DoLoopOp doLoop, OpAdaptor adaptor,
4038
mlir::ConversionPatternRewriter &rewriter) const override {
39+
// TODO This will be filled in with the next PRs that upstreams the rest of
40+
// the ROCm implementaion.
4141
return mlir::success();
4242
}
4343

4444
bool mapToDevice;
45-
llvm::DenseSet<fir::DoLoopOp> &concurrentLoopsToSkip;
4645
};
4746

4847
class DoConcurrentConversionPass
@@ -58,9 +57,8 @@ class DoConcurrentConversionPass
5857
void runOnOperation() override {
5958
mlir::func::FuncOp func = getOperation();
6059

61-
if (func.isDeclaration()) {
60+
if (func.isDeclaration())
6261
return;
63-
}
6462

6563
auto *context = &getContext();
6664

@@ -72,15 +70,12 @@ class DoConcurrentConversionPass
7270
return;
7371
}
7472

75-
llvm::DenseSet<fir::DoLoopOp> concurrentLoopsToSkip;
7673
mlir::RewritePatternSet patterns(context);
7774
patterns.insert<DoConcurrentConversion>(
78-
context, mapTo == flangomp::DoConcurrentMappingKind::DCMK_Device,
79-
concurrentLoopsToSkip);
75+
context, mapTo == flangomp::DoConcurrentMappingKind::DCMK_Device);
8076
mlir::ConversionTarget target(*context);
81-
target.addDynamicallyLegalOp<fir::DoLoopOp>([&](fir::DoLoopOp op) {
82-
return !op.getUnordered() || concurrentLoopsToSkip.contains(op);
83-
});
77+
target.addDynamicallyLegalOp<fir::DoLoopOp>(
78+
[&](fir::DoLoopOp op) { return !op.getUnordered(); });
8479
target.markUnknownOpDynamicallyLegal(
8580
[](mlir::Operation *) { return true; });
8681

0 commit comments

Comments
 (0)