Skip to content

Commit 5806eac

Browse files
committed
Update MapInfoFinalization pass to look for MapInfoOps inside DeclareMapperOps as well as inside the Module.
1 parent 7e504c8 commit 5806eac

File tree

2 files changed

+46
-41
lines changed

2 files changed

+46
-41
lines changed

flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,10 @@ class MapInfoFinalizationPass
485485
// ourselves to the possibility of race conditions while this pass
486486
// undergoes frequent re-iteration for the near future. So we loop
487487
// over function in the module and then map.info inside of those.
488-
getOperation()->walk([&](mlir::func::FuncOp func) {
488+
getOperation()->walk([&](mlir::Operation *func) {
489+
if (!(mlir::isa<mlir::func::FuncOp>(func) ||
490+
mlir::isa<mlir::omp::DeclareMapperOp>(func)))
491+
return;
489492
// clear all local allocations we made for any boxes in any prior
490493
// iterations from previous function scopes.
491494
localBoxAllocas.clear();

0 commit comments

Comments
 (0)