@@ -334,12 +334,16 @@ bool CodeGenAction::beginSourceFileAction() {
334334 ci.getInvocation ().getFrontendOpts ().features .IsEnabled (
335335 Fortran::common::LanguageFeature::OpenMP);
336336
337+ fir::OpenMPFIRPassPipelineOpts opts;
338+
337339 using DoConcurrentMappingKind =
338340 Fortran::frontend::CodeGenOptions::DoConcurrentMappingKind;
339- DoConcurrentMappingKind doConcurrentMappingKind =
341+ opts. doConcurrentMappingKind =
340342 ci.getInvocation ().getCodeGenOpts ().getDoConcurrentMapping ();
343+ opts.enableOffloadGlobalFiltering =
344+ ci.getInvocation ().getCodeGenOpts ().OffloadGlobalFiltering ;
341345
342- if (doConcurrentMappingKind != DoConcurrentMappingKind::DCMK_None &&
346+ if (opts. doConcurrentMappingKind != DoConcurrentMappingKind::DCMK_None &&
343347 !isOpenMPEnabled) {
344348 unsigned diagID = ci.getDiagnostics ().getCustomDiagID (
345349 clang::DiagnosticsEngine::Warning,
@@ -349,15 +353,15 @@ bool CodeGenAction::beginSourceFileAction() {
349353 }
350354
351355 if (isOpenMPEnabled) {
352- bool isDevice = false ;
356+ opts. isTargetDevice = false ;
353357 if (auto offloadMod = llvm::dyn_cast<mlir::omp::OffloadModuleInterface>(
354358 mlirModule->getOperation ()))
355- isDevice = offloadMod.getIsTargetDevice ();
359+ opts. isTargetDevice = offloadMod.getIsTargetDevice ();
356360
357361 // WARNING: This pipeline must be run immediately after the lowering to
358362 // ensure that the FIR is correct with respect to OpenMP operations/
359363 // attributes.
360- fir::createOpenMPFIRPassPipeline (pm, isDevice, doConcurrentMappingKind );
364+ fir::createOpenMPFIRPassPipeline (pm, opts );
361365 }
362366
363367 pm.enableVerifier (/* verifyPasses=*/ true );
@@ -371,7 +375,6 @@ bool CodeGenAction::beginSourceFileAction() {
371375 return false ;
372376 }
373377
374-
375378 // Print initial full MLIR module, before lowering or transformations, if
376379 // -save-temps has been specified.
377380 if (!saveMLIRTempFile (ci.getInvocation (), *mlirModule, getCurrentFile (),
0 commit comments