[lld] 80f0ffb - [lld][WebAssembly] Set the target-cpu in LTO config (#140010)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 20 17:29:04 PDT 2025


Author: YAMAMOTO Takashi
Date: 2025-05-20T17:29:01-07:00
New Revision: 80f0ffb937940cf98d9dd6c6b5c1b8772e35bab2

URL: https://github.com/llvm/llvm-project/commit/80f0ffb937940cf98d9dd6c6b5c1b8772e35bab2
DIFF: https://github.com/llvm/llvm-project/commit/80f0ffb937940cf98d9dd6c6b5c1b8772e35bab2.diff

LOG: [lld][WebAssembly] Set the target-cpu in LTO config (#140010)

I couldn't find an existing way to pass -mcpu=lime1 equivalent to LTO
codegen.
This commit would privide one. With this commit, you can do so by
passing
`-mllvm -mcpu=lime1` to wasm-ld.

Added: 
    

Modified: 
    lld/wasm/LTO.cpp

Removed: 
    


################################################################################
diff  --git a/lld/wasm/LTO.cpp b/lld/wasm/LTO.cpp
index a877f067603e5..581104745b8ba 100644
--- a/lld/wasm/LTO.cpp
+++ b/lld/wasm/LTO.cpp
@@ -59,6 +59,7 @@ static lto::Config createConfig() {
   c.DisableVerify = ctx.arg.disableVerify;
   c.DiagHandler = diagnosticHandler;
   c.OptLevel = ctx.arg.ltoo;
+  c.CPU = getCPUStr();
   c.MAttrs = getMAttrs();
   c.CGOptLevel = ctx.arg.ltoCgo;
   c.DebugPassManager = ctx.arg.ltoDebugPassManager;


        


More information about the llvm-commits mailing list