Skip to content

Commit 04b5656

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 8c2b4aa commit 04b5656

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
@@ -6910,6 +6910,10 @@ defm loop_versioning : BoolOptionWithoutMarshalling<"f", "version-loops-for-stri
69106910

69116911
def fhermetic_module_files : Flag<["-"], "fhermetic-module-files">, Group<f_Group>,
69126912
HelpText<"Emit hermetic module files (no nested USE association)">;
6913+
6914+
def do_concurrent_parallel_EQ : Joined<["-"], "fdo-concurrent-parallel=">,
6915+
HelpText<"Try to map `do concurrent` loops to OpenMP [none|host|device]">,
6916+
Values<"none,host,device">;
69136917
} // let Visibility = [FC1Option, FlangOption]
69146918

69156919
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)