Skip to content

Commit

Permalink
[MLIR][OpenMP] Add case for TargetDataOp when traversing inner regions
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjodin committed Mar 28, 2024
1 parent d5bf7d3 commit 2e08836
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3622,16 +3622,24 @@ convertInternalTargetOp(Operation *op, llvm::IRBuilderBase &builder,

static LogicalResult
convertTopLevelTargetOp(Operation *op, llvm::IRBuilderBase &builder,
LLVM::ModuleTranslation &moduleTranslation) {
LLVM::ModuleTranslation &moduleTranslation) {
if (isa<omp::TargetOp>(op))
return convertOmpTarget(*op, builder, moduleTranslation);
if (isa<omp::TargetDataOp>(op))
return convertOmpTargetData(op, builder, moduleTranslation);
bool interrupted =
op->walk<WalkOrder::PreOrder>([&](omp::TargetOp targetOp) {
if (failed(convertOmpTarget(*targetOp, builder, moduleTranslation)))
return WalkResult::interrupt();
return WalkResult::skip();
op->walk<WalkOrder::PreOrder>([&](Operation *oper) {
if (isa<omp::TargetOp>(oper)) {
if (failed(convertOmpTarget(*oper, builder, moduleTranslation)))
return WalkResult::interrupt();
return WalkResult::skip();
}
if (isa<omp::TargetDataOp>(oper)) {
if (failed(convertOmpTargetData(oper, builder, moduleTranslation)))
return WalkResult::interrupt();
return WalkResult::skip();
}
return WalkResult::advance();
}).wasInterrupted();
return failure(interrupted);
}
Expand Down

0 comments on commit 2e08836

Please sign in to comment.