Skip to content

Commit 3a13116

Browse files
committed
Review comments
1 parent ba6d59c commit 3a13116

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

+4-8
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static LogicalResult checkImplementationStatus(Operation &op) {
162162
omp::ClauseCancellationConstructType cancelledDirective =
163163
op.getCancelDirective();
164164
if (cancelledDirective != omp::ClauseCancellationConstructType::Parallel)
165-
result = todo("cancel directive");
165+
result = todo("cancel directive construct type not yet supported");
166166
};
167167
auto checkDepend = [&todo](auto op, LogicalResult &result) {
168168
if (!op.getDependVars().empty() || op.getDependKinds())
@@ -1591,15 +1591,11 @@ cleanupPrivateVars(llvm::IRBuilderBase &builder,
15911591
static bool constructIsCancellable(Operation *op) {
15921592
// omp.cancel must be "closely nested" so it will be visible and not inside of
15931593
// funcion calls. This is enforced by the verifier.
1594-
bool containsCancel = false;
1595-
op->walk([&containsCancel](Operation *child) {
1596-
if (mlir::isa<omp::CancelOp>(child)) {
1597-
containsCancel = true;
1594+
return op->walk([](Operation *child) {
1595+
if (mlir::isa<omp::CancelOp>(child))
15981596
return WalkResult::interrupt();
1599-
}
16001597
return WalkResult::advance();
1601-
});
1602-
return containsCancel;
1598+
}).wasInterrupted();
16031599
}
16041600

16051601
static LogicalResult

mlir/test/Target/LLVMIR/openmp-todo.mlir

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ llvm.func @cancel_wsloop(%lb : i32, %ub : i32, %step: i32) {
3131
omp.wsloop {
3232
// expected-error@below {{LLVM Translation failed for operation: omp.loop_nest}}
3333
omp.loop_nest (%iv) : i32 = (%lb) to (%ub) step (%step) {
34-
// expected-error@below {{not yet implemented: Unhandled clause cancel directive in omp.cancel operation}}
34+
// expected-error@below {{not yet implemented: Unhandled clause cancel directive construct type not yet supported in omp.cancel operation}}
3535
// expected-error@below {{LLVM Translation failed for operation: omp.cancel}}
3636
omp.cancel cancellation_construct_type(loop)
3737
omp.yield
@@ -46,7 +46,7 @@ llvm.func @cancel_sections() {
4646
// expected-error@below {{LLVM Translation failed for operation: omp.sections}}
4747
omp.sections {
4848
omp.section {
49-
// expected-error@below {{not yet implemented: Unhandled clause cancel directive in omp.cancel operation}}
49+
// expected-error@below {{not yet implemented: Unhandled clause cancel directive construct type not yet supported in omp.cancel operation}}
5050
// expected-error@below {{LLVM Translation failed for operation: omp.cancel}}
5151
omp.cancel cancellation_construct_type(sections)
5252
omp.terminator
@@ -63,7 +63,7 @@ llvm.func @cancel_taskgroup() {
6363
omp.taskgroup {
6464
// expected-error@below {{LLVM Translation failed for operation: omp.task}}
6565
omp.task {
66-
// expected-error@below {{not yet implemented: Unhandled clause cancel directive in omp.cancel operation}}
66+
// expected-error@below {{not yet implemented: Unhandled clause cancel directive construct type not yet supported in omp.cancel operation}}
6767
// expected-error@below {{LLVM Translation failed for operation: omp.cancel}}
6868
omp.cancel cancellation_construct_type(taskgroup)
6969
omp.terminator

0 commit comments

Comments
 (0)