Skip to content

[lld][WebAssembly] Set the target-cpu in LTO config #140010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lld/wasm/LTO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ static lto::Config createConfig() {
c.DisableVerify = ctx.arg.disableVerify;
c.DiagHandler = diagnosticHandler;
c.OptLevel = ctx.arg.ltoo;
c.CPU = getCPUStr();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup this looks like this is already present in the ELF version of createConfig .. I wonder why we didn't have it here before.

Can we write a test for this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried removing this line from the ELF linker and all the tests still passed.. so maybe testing is not easy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i noticed this while building an application. i don't have smaller test cases right now.

c.MAttrs = getMAttrs();
c.CGOptLevel = ctx.arg.ltoCgo;
c.DebugPassManager = ctx.arg.ltoDebugPassManager;
Expand Down