[flang-commits] [flang] [Flang] - Enhance testing for strictly-nested teams in target regions. (PR #168437)

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Mon Nov 24 00:14:59 PST 2025


================
@@ -262,6 +262,15 @@ void OmpStructureChecker::Enter(const parser::OpenMPLoopConstruct &x) {
     EnterDirectiveNest(SIMDNest);
   }
 
+  if (CurrentDirectiveIsNested() &&
+      llvm::omp::topTeamsSet.test(GetContext().directive) &&
+      GetContextParent().directive == llvm::omp::Directive::OMPD_target &&
+      !GetDirectiveNest(TargetBlockOnlyTeams)) {
----------------
ergawy wrote:

>I am torn between spending time fixing it on the one hand while on the other hand letting what seems to be an obscure case slide.

No need to fix it, at least in this PR. Specially since the test is used somewhere else. The way the directive-nest test is currently implemented is just surprising to me (seems a bit too permisive) and wanted to verify if this is really the case.

https://github.com/llvm/llvm-project/pull/168437


More information about the flang-commits mailing list