[PATCH] D155326: [Clang][lld][RISCV] Passing 'mattr' to lld/llvmgold

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 14 13:11:54 PDT 2023


craig.topper added a comment.

In D155326#4502097 <https://reviews.llvm.org/D155326#4502097>, @dtcxzyw wrote:

> In D155326#4501997 <https://reviews.llvm.org/D155326#4501997>, @jrtc27 wrote:
>
>> Why do you believe this is better than encoding it in the module's IR like the ABI?
>
>
>
> - There is no module-level metadata for target CPU and sub-target features. So I just think that this patch is better than merging from **func-level** attributes like D142191 <https://reviews.llvm.org/D142191>.
> - Clang passes `-plugin-opt=mcpu` to lld. Then lld builds `lto::Config` using `codegen::getCPUStr` and `codegen::getMAttrs` (both get the result from command args). It is taken for granted that clang passes `-plugin-opt=mattr` down to lld.
>
> If we introduce top-level fields like `target cpu` and `target features`, we should modify a lot of things (clang/llvm/lld). It can take a long time to migrate (like opaque pointers).

You're right it might take time, but we've been saying that's what needs to be done for a year. It might have been done by now if the work had gotten started.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155326/new/

https://reviews.llvm.org/D155326



More information about the cfe-commits mailing list