Skip to content

Commit d1ed094

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 84e3c6f commit d1ed094

File tree

18 files changed

+720
-10
lines changed

18 files changed

+720
-10
lines changed

clang/include/clang/Driver/Options.td

+4
Original file line numberDiff line numberDiff line change
@@ -6919,6 +6919,10 @@ defm loop_versioning : BoolOptionWithoutMarshalling<"f", "version-loops-for-stri
69196919

69206920
def fhermetic_module_files : Flag<["-"], "fhermetic-module-files">, Group<f_Group>,
69216921
HelpText<"Emit hermetic module files (no nested USE association)">;
6922+
6923+
def do_concurrent_parallel_EQ : Joined<["-"], "fdo-concurrent-to-openmp=">,
6924+
HelpText<"Try to map `do concurrent` loops to OpenMP [none|host|device]">,
6925+
Values<"none,host,device">;
69226926
} // let Visibility = [FC1Option, FlangOption]
69236927

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

clang/lib/Driver/ToolChains/Flang.cpp

+2-1
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)