Skip to content

Commit 1ff501d

Browse files
authored
Merge pull request llvm#171 from AMD-Lightning-Internal/amd/dev/rlieberm/FortranDrop002
Initial Flang-new drop 001
2 parents 7a2580b + ab61775 commit 1ff501d

File tree

148 files changed

+7617
-2631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+7617
-2631
lines changed

.github/workflows/release-binaries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ jobs:
328328
run: |
329329
# Build some of the mlir tools that take a long time to link
330330
if [ "${{ needs.prepare.outputs.build-flang }}" = "true" ]; then
331-
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang bbc
331+
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang-new bbc
332332
fi
333333
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ \
334334
mlir-bytecode-parser-fuzzer \

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,3 @@ def ExtractAPIMisuse : DiagGroup<"extractapi-misuse">;
15931593
// Warnings about using the non-standard extension having an explicit specialization
15941594
// with a storage class specifier.
15951595
def ExplicitSpecializationStorageClass : DiagGroup<"explicit-specialization-storage-class">;
1596-
1597-
// A warning for options that enable a feature that is not yet complete
1598-
def ExperimentalOption : DiagGroup<"experimental-option">;

clang/include/clang/Driver/Options.td

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7102,6 +7102,7 @@ defm xor_operator : OptInFC1FFlag<"xor-operator", "Enable .XOR. as a synonym of
71027102
defm logical_abbreviations : OptInFC1FFlag<"logical-abbreviations", "Enable logical abbreviations">;
71037103
defm implicit_none : OptInFC1FFlag<"implicit-none", "No implicit typing allowed unless overridden by IMPLICIT statements">;
71047104
defm underscoring : OptInFC1FFlag<"underscoring", "Appends one trailing underscore to external names">;
7105+
defm offload_global_filtering : OptInFC1FFlag<"offload-global-filtering", "Enable/disable OpenMP global filtering pass">;
71057106
defm ppc_native_vec_elem_order: BoolOptionWithoutMarshalling<"f", "ppc-native-vector-element-order",
71067107
PosFlag<SetTrue, [], [ClangOption], "Specifies PowerPC native vector element order (default)">,
71077108
NegFlag<SetFalse, [], [ClangOption], "Specifies PowerPC non-native vector element order">>;
@@ -7122,6 +7123,10 @@ defm loop_versioning : BoolOptionWithoutMarshalling<"f", "version-loops-for-stri
71227123

71237124
def fhermetic_module_files : Flag<["-"], "fhermetic-module-files">, Group<f_Group>,
71247125
HelpText<"Emit hermetic module files (no nested USE association)">;
7126+
7127+
def do_concurrent_parallel_EQ : Joined<["-"], "fdo-concurrent-parallel=">,
7128+
HelpText<"Try to map `do concurrent` loops to OpenMP (on host or device)">,
7129+
Values<"none,host,device">;
71257130
} // let Visibility = [FC1Option, FlangOption]
71267131

71277132
def J : JoinedOrSeparate<["-"], "J">,
@@ -8503,7 +8508,7 @@ def source_date_epoch : Separate<["-"], "source-date-epoch">,
85038508
// CUDA Options
85048509
//===----------------------------------------------------------------------===//
85058510

8506-
let Visibility = [CC1Option] in {
8511+
let Visibility = [CC1Option, FC1Option] in {
85078512

85088513
def fcuda_is_device : Flag<["-"], "fcuda-is-device">,
85098514
HelpText<"Generate code for CUDA device">,

clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,6 @@ void CGOpenMPRuntimeGPU::emitReduction(
18931893
return;
18941894

18951895
bool ParallelReduction = isOpenMPParallelDirective(Options.ReductionKind);
1896-
bool DistributeReduction = isOpenMPDistributeDirective(Options.ReductionKind);
18971896
bool TeamsReduction = isOpenMPTeamsDirective(Options.ReductionKind);
18981897

18991898
ASTContext &C = CGM.getContext();
@@ -1990,7 +1989,7 @@ void CGOpenMPRuntimeGPU::emitReduction(
19901989
llvm::OpenMPIRBuilder::InsertPointTy AfterIP =
19911990
cantFail(OMPBuilder.createReductionsGPU(
19921991
OmpLoc, AllocaIP, CodeGenIP, ReductionInfos, false, TeamsReduction,
1993-
DistributeReduction, llvm::OpenMPIRBuilder::ReductionGenCBKind::Clang,
1992+
llvm::OpenMPIRBuilder::ReductionGenCBKind::Clang,
19941993
CGF.getTarget().getGridValue(),
19951994
C.getLangOpts().OpenMPCUDAReductionBufNum, RTLoc));
19961995
CGF.Builder.restoreIP(AfterIP);

clang/lib/Driver/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2256,7 +2256,7 @@ void Driver::PrintHelp(bool ShowHidden) const {
22562256

22572257
void Driver::PrintVersion(const Compilation &C, raw_ostream &OS) const {
22582258
if (IsFlangMode()) {
2259-
OS << getClangToolFullVersion("alpha flang-new") << '\n';
2259+
OS << getClangToolFullVersion("flang-new") << '\n';
22602260
} else {
22612261
// FIXME: The following handlers should use a callback mechanism, we don't
22622262
// know what the client would like to do.

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9139,7 +9139,9 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
91399139
assert(Input.isFilename() && "Invalid input.");
91409140
CmdArgs.push_back(Input.getFilename());
91419141

9142-
const char *Exec = getToolChain().getDriver().getClangProgramPath();
9142+
// TODO This is a workaround to enable using -save-temps with flang-new
9143+
// const char *Exec = getToolChain().getDriver().getClangProgramPath();
9144+
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("clang"));
91439145
if (D.CC1Main && !D.CCGenDiagnostics) {
91449146
// Invoke cc1as directly in this process.
91459147
C.addCommand(std::make_unique<CC1Command>(

clang/lib/Driver/ToolChains/Flang.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ void Flang::addOtherOptions(const ArgList &Args, ArgStringList &CmdArgs) const {
124124
options::OPT_std_EQ, options::OPT_W_Joined,
125125
options::OPT_fconvert_EQ, options::OPT_fpass_plugin_EQ,
126126
options::OPT_funderscoring, options::OPT_fno_underscoring,
127+
options::OPT_foffload_global_filtering,
128+
options::OPT_fno_offload_global_filtering,
127129
options::OPT_funsigned, options::OPT_fno_unsigned});
128130

129131
llvm::codegenoptions::DebugInfoKind DebugInfoKind;
@@ -151,7 +153,8 @@ void Flang::addCodegenOptions(const ArgList &Args,
151153
CmdArgs.push_back("-fversion-loops-for-stride");
152154

153155
Args.addAllArgs(CmdArgs,
154-
{options::OPT_flang_experimental_hlfir,
156+
{options::OPT_do_concurrent_parallel_EQ,
157+
options::OPT_flang_experimental_hlfir,
155158
options::OPT_flang_deprecated_no_hlfir,
156159
options::OPT_fno_ppc_native_vec_elem_order,
157160
options::OPT_fppc_native_vec_elem_order,

clang/test/ClangScanDeps/multiple-commands.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
// CHECK-NEXT: "{{.*}}tu_save_temps_module.o"
135135
// CHECK: "{{.*}}tu_save_temps_module.s"
136136
// CHECK: ]
137-
// CHECK-NEXT: "executable": "clang_tool"
137+
// CHECK-NEXT: "executable": [[CLANG:"[^"]*clang"]]
138138
// CHECK: "input-file": "[[PREFIX]]{{.}}tu_save_temps_module.c"
139139
// CHECK-NEXT: }
140140
// CHECK-NEXT: ]

clang/test/Driver/hip-target-id.hip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// CHECK-SAME: "-target-feature" "+sramecc"
2727
// CHECK-SAME: "-target-feature" "+xnack"
2828

29-
// TMP: [[CLANG:"[^"]*clang[^"]*"]] "-cc1as" "-triple" "amdgcn-amd-amdhsa"
29+
// TMP: [[CLANG_TMP:"[^"]*clang"]] "-cc1as" "-triple" "amdgcn-amd-amdhsa"
3030
// TMP-SAME: "-target-cpu" "gfx908"
3131
// TMP-SAME: "-target-feature" "+sramecc"
3232
// TMP-SAME: "-target-feature" "+xnack"

0 commit comments

Comments
 (0)