Skip to content

Commit 2a54270

Browse files
committed
[flang][OpenMP] Upstream first part of do concurrent mapping
This PR starts the effort to upstream AMD's internal implementation of `do concurrent` to OpenMP mapping. This replaces llvm#77285 since we extended this WIP quite a bit on our fork over the past year. An important part of this PR is a document that describes the current status downstream, the upstreaming status, and next steps to make this pass much more useful. In addition to this document, this PR also contains the skeleton of the pass (no useful transformations are done yet) and some testing for the added command line options.
1 parent de06978 commit 2a54270

File tree

18 files changed

+720
-10
lines changed

18 files changed

+720
-10
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6927,6 +6927,10 @@ defm loop_versioning : BoolOptionWithoutMarshalling<"f", "version-loops-for-stri
69276927

69286928
def fhermetic_module_files : Flag<["-"], "fhermetic-module-files">, Group<f_Group>,
69296929
HelpText<"Emit hermetic module files (no nested USE association)">;
6930+
6931+
def do_concurrent_parallel_EQ : Joined<["-"], "fdo-concurrent-to-openmp=">,
6932+
HelpText<"Try to map `do concurrent` loops to OpenMP [none|host|device]">,
6933+
Values<"none,host,device">;
69306934
} // let Visibility = [FC1Option, FlangOption]
69316935

69326936
def J : JoinedOrSeparate<["-"], "J">,

clang/lib/Driver/ToolChains/Flang.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ void Flang::addCodegenOptions(const ArgList &Args,
153153
CmdArgs.push_back("-fversion-loops-for-stride");
154154

155155
Args.addAllArgs(CmdArgs,
156-
{options::OPT_flang_experimental_hlfir,
156+
{options::OPT_do_concurrent_parallel_EQ,
157+
options::OPT_flang_experimental_hlfir,
157158
options::OPT_flang_deprecated_no_hlfir,
158159
options::OPT_fno_ppc_native_vec_elem_order,
159160
options::OPT_fppc_native_vec_elem_order,

0 commit comments

Comments
 (0)