Skip to content

Commit f5f8c05

Browse files
arsenmronlieb
authored andcommitted
Revert "Add clang-linker-wrapper option to specify the lto optimization pipeline"
This reverts commit dff11dd. Reason for revert: None done upstream Change-Id: I55394fe4de7be6c7a5b90e8edd118f7980989f3a
1 parent 6b1e24a commit f5f8c05

File tree

7 files changed

+0
-108
lines changed

7 files changed

+0
-108
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,12 +1236,6 @@ def offload_host_device : Flag<["--"], "offload-host-device">,
12361236
Visibility<[ClangOption, FlangOption]>,
12371237
HelpText<"Compile for both the offloading host and device (default).">;
12381238

1239-
def offload_lto_opt_pipeline_EQ : Joined<["-"], "offload-lto-opt-pipeline=">,
1240-
Visibility<[ClangOption, FlangOption]>,
1241-
HelpText<"Optimization pipeline to use during offload linking. Defaults to"
1242-
" 'default<On>' where n is based on -O">;
1243-
1244-
12451239
def gpu_use_aux_triple_only : Flag<["--"], "gpu-use-aux-triple-only">,
12461240
InternalDriverOpt, HelpText<"Prepare '-aux-triple' only without populating "
12471241
"'-aux-target-cpu' and '-aux-target-feature'.">;

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9729,26 +9729,6 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
97299729
if (Args.getLastArg(options::OPT_save_temps_EQ))
97309730
CmdArgs.push_back("--save-temps");
97319731

9732-
if (const Arg *A =
9733-
Args.getLastArg(options::OPT_offload_lto_opt_pipeline_EQ)) {
9734-
CmdArgs.push_back(
9735-
Args.MakeArgString(Twine("--lto-opt-pipeline=") + A->getValue()));
9736-
} else if (D.getOffloadLTOMode() == LTOK_Full ||
9737-
D.getOffloadLTOMode() == LTOK_Thin ||
9738-
D.getLTOMode() == LTOK_Full || D.getLTOMode() == LTOK_Thin) {
9739-
StringRef val;
9740-
// OffloadLTOMode takes precedence over LTOMode
9741-
if (D.getOffloadLTOMode() == LTOK_Full)
9742-
val = "lto";
9743-
else if (D.getOffloadLTOMode() == LTOK_Thin)
9744-
val = "thinlto";
9745-
else if (D.getLTOMode() == LTOK_Full)
9746-
val = "lto";
9747-
else
9748-
val = "thinlto";
9749-
CmdArgs.push_back(Args.MakeArgString("--lto-opt-pipeline=" + val));
9750-
}
9751-
97529732
// Construct the link job so we can wrap around it.
97539733
Linker->ConstructJob(C, JA, Output, Inputs, Args, LinkingOutput);
97549734
const auto &LinkCommand = C.getJobs().getJobs().back();

clang/test/Driver/amdgpu-openmp-toolchain-new.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,3 @@
5252

5353
// RUN: %clang -### -target x86_64-pc-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 --no-opaque-offload-linker -lm --rocm-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode %s 2>&1 | FileCheck %s --check-prefix=CHECK-LIB-DEVICE-NEW
5454
// CHECK-LIB-DEVICE-NEW: {{.*}}"-target-cpu" "gfx803"{{.*}}ocml.bc"{{.*}}oclc_daz_opt_on.bc"{{.*}}oclc_unsafe_math_off.bc"{{.*}}oclc_finite_only_off.bc"{{.*}}oclc_correctly_rounded_sqrt_on.bc"{{.*}}oclc_wavefrontsize64_on.bc"{{.*}}oclc_isa_version_803.bc"
55-
56-
// RUN: CLANG_USE_LINKER_WRAPPER=1 %clang -### --target=x86_64-unknown-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-LTO-OPT-PL-00
57-
// CHECK-LTO-OPT-PL-00-NOT: clang-linker-wrapper{{.*}} "--lto-opt-pipeline"
58-
59-
// RUN: CLANG_USE_LINKER_WRAPPER=1 %clang -### --target=x86_64-unknown-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 -nogpulib -offload-lto-opt-pipeline=lto %s 2>&1 | FileCheck %s --check-prefix=CHECK-LTO-OPT-PL-01
60-
// RUN: CLANG_USE_LINKER_WRAPPER=1 %clang -### --target=x86_64-unknown-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 -nogpulib -flto %s 2>&1 | FileCheck %s --check-prefix=CHECK-LTO-OPT-PL-01
61-
// CHECK-LTO-OPT-PL-01: clang-linker-wrapper{{.*}} "--lto-opt-pipeline=lto"
62-
63-
// RUN: CLANG_USE_LINKER_WRAPPER=1 %clang -### --target=x86_64-unknown-linux-gnu -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 -nogpulib "-offload-lto-opt-pipeline=default<O3>" %s 2>&1 | FileCheck %s --check-prefix=CHECK-LTO-OPT-PL-02
64-
// CHECK-LTO-OPT-PL-02: clang-linker-wrapper{{.*}} "--lto-opt-pipeline=default<O3>"

clang/test/Driver/linker-wrapper-lto-opt-pipeline.c

Lines changed: 0 additions & 43 deletions
This file was deleted.

clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -570,17 +570,6 @@ Expected<StringRef> clang(ArrayRef<StringRef> InputFiles, const ArgList &Args) {
570570

571571
for (StringRef Arg : Args.getAllArgValues(OPT_linker_arg_EQ))
572572
CmdArgs.append({"-Xlinker", Args.MakeArgString(Arg)});
573-
574-
StringRef ltoOptPipeline = Args.getLastArgValue(OPT_lto_opt_pipeline_EQ, "");
575-
if (ltoOptPipeline == "lto" || ltoOptPipeline == "default") {
576-
// for convenience, add "<On>"
577-
ltoOptPipeline = Args.MakeArgString(ltoOptPipeline + "<" + OptLevel + ">");
578-
}
579-
if (ltoOptPipeline.size()) {
580-
CmdArgs.append({"-Xlinker", Args.MakeArgString("--lto-newpm-passes=" +
581-
ltoOptPipeline)});
582-
}
583-
584573
for (StringRef Arg : Args.getAllArgValues(OPT_compiler_arg_EQ))
585574
CmdArgs.push_back(Args.MakeArgString(Arg));
586575

clang/tools/clang-linker-wrapper/LinkerWrapperOpts.td

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ def override_image : Joined<["--"], "override-image=">,
7171
Flags<[WrapperOnlyOption]>, MetaVarName<"<kind=file>">,
7272
HelpText<"Uses the provided file as if it were the output of the device link step">;
7373

74-
def lto_opt_pipeline_EQ : Joined<["--"], "lto-opt-pipeline=">,
75-
Flags<[WrapperOnlyOption]>,
76-
HelpText<"Optimization pipeline to use during LTO. Defaults to 'default<On>'"
77-
" where n is based on --opt-level">;
78-
7974
// Flags passed to the device linker.
8075
def arch_EQ : Joined<["--"], "arch=">,
8176
Flags<[DeviceOnlyOption, HelpHidden]>, MetaVarName<"<arch>">,

flang/test/Driver/offload-lto-pipeline.f90

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)