[clang] [AMDGPU] Correctly pass the target-id to `ld.lld` (PR #101037)
Matt Arsenault via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 29 09:37:03 PDT 2024
================
@@ -634,7 +634,17 @@ void amdgpu::Linker::ConstructJob(Compilation &C, const JobAction &JA,
C.getDriver().getLTOMode() == LTOK_Thin);
else if (Args.hasArg(options::OPT_mcpu_EQ))
CmdArgs.push_back(Args.MakeArgString(
- "-plugin-opt=mcpu=" + Args.getLastArgValue(options::OPT_mcpu_EQ)));
+ "-plugin-opt=mcpu=" +
+ getProcessorFromTargetID(getToolChain().getTriple(),
+ Args.getLastArgValue(options::OPT_mcpu_EQ))));
+
+ // Always pass the target-id features to the LTO job.
+ std::vector<StringRef> Features;
+ getAMDGPUTargetFeatures(C.getDriver(), getToolChain().getTriple(), Args,
+ Features);
+ if (!Features.empty())
----------------
arsenm wrote:
Braces
https://github.com/llvm/llvm-project/pull/101037
More information about the cfe-commits
mailing list