diff --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp --- a/flang/lib/Parser/openmp-parsers.cpp +++ b/flang/lib/Parser/openmp-parsers.cpp @@ -315,7 +315,8 @@ pure(llvm::omp::Directive::OMPD_teams_distribute_parallel_do), "TEAMS DISTRIBUTE SIMD" >> pure(llvm::omp::Directive::OMPD_teams_distribute_simd), - "TEAMS DISTRIBUTE" >> pure(llvm::omp::Directive::OMPD_teams_distribute))))) + "TEAMS DISTRIBUTE" >> pure(llvm::omp::Directive::OMPD_teams_distribute), + "TILE" >> pure(llvm::omp::Directive::OMPD_tile))))) TYPE_PARSER(sourced(construct( sourced(Parser{}), Parser{}))) diff --git a/flang/lib/Parser/unparse.cpp b/flang/lib/Parser/unparse.cpp --- a/flang/lib/Parser/unparse.cpp +++ b/flang/lib/Parser/unparse.cpp @@ -2142,6 +2142,9 @@ case llvm::omp::Directive::OMPD_teams_distribute_simd: Word("TEAMS DISTRIBUTE SIMD "); break; + case llvm::omp::Directive::OMPD_tile: + Word("TILE "); + break; default: break; } diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp --- a/flang/lib/Semantics/resolve-directives.cpp +++ b/flang/lib/Semantics/resolve-directives.cpp @@ -1200,6 +1200,7 @@ case llvm::omp::Directive::OMPD_teams_distribute_parallel_do: case llvm::omp::Directive::OMPD_teams_distribute_parallel_do_simd: case llvm::omp::Directive::OMPD_teams_distribute_simd: + case llvm::omp::Directive::OMPD_tile: PushContext(beginDir.source, beginDir.v); break; default: diff --git a/flang/test/Parser/omp-tile.f90 b/flang/test/Parser/omp-tile.f90 new file mode 100644 --- /dev/null +++ b/flang/test/Parser/omp-tile.f90 @@ -0,0 +1,22 @@ +! RUN: %flang_fc1 -fdebug-unparse -fopenmp %s | FileCheck --ignore-case %s +! RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s + +subroutine openmp_tiles(x, y) + + integer, intent(inout)::x, y + +!CHECK: !$omp tile +!$omp tile +!CHECK: do + do x = 1, 100 + call F1(); +!CHECK: end do + end do; +!CHECK: !$omp end tile +!$omp end tile + +!PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct +!PARSE-TREE: OmpBeginLoopDirective +!PARSE-TREE: OmpLoopDirective -> llvm::omp::Directive = tile + +END subroutine openmp_tiles