[PATCH] D144505: [Clang] Add options in LTO mode when cross compiling for AMDGPU
Joseph Huber via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 22 08:14:25 PST 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc45d2df05e0e: [Clang] Add options in LTO mode when cross compiling for AMDGPU (authored by jhuber6).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144505/new/
https://reviews.llvm.org/D144505
Files:
clang/lib/Driver/ToolChains/AMDGPU.cpp
clang/test/Driver/amdgpu-toolchain.c
Index: clang/test/Driver/amdgpu-toolchain.c
===================================================================
--- clang/test/Driver/amdgpu-toolchain.c
+++ clang/test/Driver/amdgpu-toolchain.c
@@ -13,4 +13,4 @@
// RUN: %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx906 -nogpulib \
// RUN: -flto %s 2>&1 | FileCheck -check-prefix=LTO %s
// LTO: clang{{.*}} "-flto=full"
-// LTO: ld.lld{{.*}}
+// LTO: ld.lld{{.*}}-plugin-opt=mcpu=gfx906
Index: clang/lib/Driver/ToolChains/AMDGPU.cpp
===================================================================
--- clang/lib/Driver/ToolChains/AMDGPU.cpp
+++ clang/lib/Driver/ToolChains/AMDGPU.cpp
@@ -540,6 +540,9 @@
ArgStringList CmdArgs;
addLinkerCompressDebugSectionsOption(getToolChain(), Args, CmdArgs);
AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
+ if (C.getDriver().isUsingLTO())
+ addLTOOptions(getToolChain(), Args, CmdArgs, Output, Inputs[0],
+ C.getDriver().getLTOMode() == LTOK_Thin);
CmdArgs.push_back("-shared");
CmdArgs.push_back("-o");
CmdArgs.push_back(Output.getFilename());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144505.499517.patch
Type: text/x-patch
Size: 1095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230222/00f8be42/attachment.bin>
More information about the cfe-commits
mailing list