Skip to content

Commit e52a29a

Browse files
committed
Update MapInfoFinalization pass to look for MapInfoOps inside DeclareMapperOps as well as inside the Module.
1 parent aba8787 commit e52a29a

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
@@ -498,7 +498,10 @@ class MapInfoFinalizationPass
498498
// ourselves to the possibility of race conditions while this pass
499499
// undergoes frequent re-iteration for the near future. So we loop
500500
// over function in the module and then map.info inside of those.
501-
getOperation()->walk([&](mlir::func::FuncOp func) {
501+
getOperation()->walk([&](mlir::Operation *func) {
502+
if (!(mlir::isa<mlir::func::FuncOp>(func) ||
503+
mlir::isa<mlir::omp::DeclareMapperOp>(func)))
504+
return;
502505
// clear all local allocations we made for any boxes in any prior
503506
// iterations from previous function scopes.
504507
localBoxAllocas.clear();

0 commit comments

Comments
 (0)