Added parser support for Tile Construct .
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D136359
"SIMD"_id >> construct<OmpClause>(construct<OmpClause::Simd>()) ||
"SIMDLEN" >> construct<OmpClause>(construct<OmpClause::Simdlen>(
parenthesized(scalarIntConstantExpr))) ||
+ "SIZES" >> construct<OmpClause>(construct<OmpClause::Sizes>(
+ parenthesized(nonemptyList(scalarIntExpr)))) ||
"THREADS" >> construct<OmpClause>(construct<OmpClause::Threads>()) ||
"THREAD_LIMIT" >> construct<OmpClause>(construct<OmpClause::ThreadLimit>(
parenthesized(scalarIntExpr))) ||
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<OmpBeginLoopDirective>(
sourced(Parser<OmpLoopDirective>{}), Parser<OmpClauseList>{})))
case llvm::omp::Directive::OMPD_teams_distribute_simd:
Word("TEAMS DISTRIBUTE SIMD ");
break;
+ case llvm::omp::Directive::OMPD_tile:
+ Word("TILE ");
+ break;
default:
break;
}
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:
--- /dev/null
+! 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)
+
+ integer, intent(inout)::x
+
+!CHECK: !$omp tile sizes
+!$omp tile sizes(2)
+!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
+!PARSE-TREE: OmpClauseList -> OmpClause -> Sizes -> Scalar -> Integer -> Expr = '2_4'
+END subroutine openmp_tiles
--- /dev/null
+! 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)
+
+ integer, intent(inout)::x
+
+!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
+
let clangClass = "OMPPrivateClause";
let flangClass = "OmpObjectList";
}
-def OMPC_Sizes: Clause<"sizes"> { let clangClass = "OMPSizesClause"; }
+def OMPC_Sizes: Clause<"sizes"> {
+ let clangClass = "OMPSizesClause";
+ let flangClass = "ScalarIntExpr";
+ let isValueList = true;
+ }
def OMPC_Full: Clause<"full"> { let clangClass = "OMPFullClause"; }
def OMPC_Partial: Clause<"partial"> { let clangClass = "OMPPartialClause"; }
def OMPC_FirstPrivate : Clause<"firstprivate"> {