From 17367562f120f28639e5e17a5c5b00d673ac9fd9 Mon Sep 17 00:00:00 2001 From: Frederik Harwath Date: Thu, 30 Mar 2023 16:22:07 +0200 Subject: [PATCH] openmp: Handle GIMPLE_OMP_METADIRECTIVE in walk_omp_for_loops gcc/ChangeLog: * omp-transform-loops.cc (walk_omp_for_loops): Handle GIMPLE_OMP_METADIRECTIVE. --- gcc/ChangeLog.omp | 5 +++++ gcc/omp-transform-loops.cc | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp index 28b3990df1a6..5e76158db068 100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,3 +1,8 @@ +2023-03-31 Frederik Harwath + + * omp-transform-loops.cc (walk_omp_for_loops): Handle + GIMPLE_OMP_METADIRECTIVE. + 2023-03-27 Julian Brown * omp-builtins.def (BUILT_IN_OMP_IS_INITIAL_DEVICE): New builtin. diff --git a/gcc/omp-transform-loops.cc b/gcc/omp-transform-loops.cc index 2e136b6d086a..ce8e8f3d0931 100644 --- a/gcc/omp-transform-loops.cc +++ b/gcc/omp-transform-loops.cc @@ -1697,6 +1697,21 @@ walk_omp_for_loops (gimple_seq *seq, walk_ctx *ctx) break; } + case GIMPLE_OMP_METADIRECTIVE: + { + gimple *variant = gimple_omp_metadirective_variants (stmt); + + while (variant) + { + gbind *bind = ctx->bind; + walk_omp_for_loops (gimple_omp_body_ptr (variant), ctx); + ctx->bind = bind; + + variant = variant->next; + } + } + break; + default: gcc_assert (!gimple_has_substatements (stmt)); continue; -- 2.47.2