Skip to content

Commit 6ffefbb

Browse files
authored
[LinkerWrapper] Remove handling of special bitcode flags (#114298)
Summary: These flags were used in the very early days while we were trying to port stuff. Now that we just pass bitcode to the device link job it can be easily replaced by `-Xoffload-linker foo.bc`.
1 parent 1cb5998 commit 6ffefbb

File tree

3 files changed

+0
-31
lines changed

3 files changed

+0
-31
lines changed

clang/docs/ClangLinkerWrapper.rst

-3
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,11 @@ only for the linker wrapper will be forwarded to the wrapped linker job.
3030
USAGE: clang-linker-wrapper [options] -- <options to passed to the linker>
3131
3232
OPTIONS:
33-
--bitcode-library=<kind>-<triple>-<arch>=<path>
34-
Extra bitcode library to link
3533
--cuda-path=<dir> Set the system CUDA path
3634
--device-debug Use debugging
3735
--device-linker=<value> or <triple>=<value>
3836
Arguments to pass to the device linker invocation
3937
--dry-run Print program arguments without running
40-
--embed-bitcode Embed linked bitcode in the module
4138
--help-hidden Display all available options
4239
--help Display available options (--help-hidden for more)
4340
--host-triple=<triple> Triple to use for the host compilation

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

-18
Original file line numberDiff line numberDiff line change
@@ -600,17 +600,6 @@ Expected<StringRef> clang(ArrayRef<StringRef> InputFiles, const ArgList &Args) {
600600
for (StringRef Arg : Args.getAllArgValues(OPT_compiler_arg_EQ))
601601
CmdArgs.push_back(Args.MakeArgString(Arg));
602602

603-
for (StringRef Arg : Args.getAllArgValues(OPT_builtin_bitcode_EQ)) {
604-
if (llvm::Triple(Arg.split('=').first) == Triple)
605-
CmdArgs.append({"-Xclang", "-mlink-builtin-bitcode", "-Xclang",
606-
Args.MakeArgString(Arg.split('=').second)});
607-
}
608-
609-
// The OpenMPOpt pass can introduce new calls and is expensive, we do
610-
// not want this when running CodeGen through clang.
611-
if (Args.hasArg(OPT_clang_backend) || Args.hasArg(OPT_builtin_bitcode_EQ))
612-
CmdArgs.append({"-mllvm", "-openmp-opt-disable"});
613-
614603
if (Error Err = executeCommands(*ClangPath, CmdArgs))
615604
return std::move(Err);
616605

@@ -1362,13 +1351,6 @@ getDeviceInput(const ArgList &Args) {
13621351
}
13631352
}
13641353

1365-
for (StringRef Library : Args.getAllArgValues(OPT_bitcode_library_EQ)) {
1366-
auto FileOrErr = getInputBitcodeLibrary(Library);
1367-
if (!FileOrErr)
1368-
return FileOrErr.takeError();
1369-
InputFiles[*FileOrErr].push_back(std::move(*FileOrErr));
1370-
}
1371-
13721354
SmallVector<SmallVector<OffloadFile>> InputsForTarget;
13731355
for (auto &[ID, Input] : InputFiles)
13741356
InputsForTarget.emplace_back(std::move(Input));

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

-10
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,12 @@ def host_triple_EQ : Joined<["--"], "host-triple=">,
2222
def opt_level : Joined<["--"], "opt-level=">,
2323
Flags<[WrapperOnlyOption]>, MetaVarName<"<O0, O1, O2, or O3>">,
2424
HelpText<"Optimization level for LTO">;
25-
def bitcode_library_EQ : Joined<["--"], "bitcode-library=">,
26-
Flags<[WrapperOnlyOption]>, MetaVarName<"<kind>-<triple>-<arch>=<path>">,
27-
HelpText<"Extra bitcode library to link">;
28-
def builtin_bitcode_EQ : Joined<["--"], "builtin-bitcode=">,
29-
Flags<[WrapperOnlyOption]>, MetaVarName<"<triple>=<path>">,
30-
HelpText<"Perform a special internalizing link on the bitcode file. "
31-
"This is necessary for some vendor libraries to be linked correctly">;
3225
def device_linker_args_EQ : Joined<["--"], "device-linker=">,
3326
Flags<[WrapperOnlyOption]>, MetaVarName<"<value> or <triple>=<value>">,
3427
HelpText<"Arguments to pass to the device linker invocation">;
3528
def device_compiler_args_EQ : Joined<["--"], "device-compiler=">,
3629
Flags<[WrapperOnlyOption]>, MetaVarName<"<value> or <triple>=<value>">,
3730
HelpText<"Arguments to pass to the device compiler invocation">;
38-
def clang_backend : Flag<["--"], "clang-backend">,
39-
Flags<[WrapperOnlyOption]>,
40-
HelpText<"Run the backend using clang rather than the LTO backend">;
4131
def dry_run : Flag<["--"], "dry-run">,
4232
Flags<[WrapperOnlyOption]>,
4333
HelpText<"Print program arguments without running">;

0 commit comments

Comments
 (0)