Skip to content
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

Seems like we generate more code than cg_llvm #587

Open
antoyo opened this issue Jan 9, 2025 · 1 comment
Open

Seems like we generate more code than cg_llvm #587

antoyo opened this issue Jan 9, 2025 · 1 comment

Comments

@antoyo
Copy link
Contributor

antoyo commented Jan 9, 2025

Compare the GIMPLE and LLVM IR for my project reproducer-memchr.

The GIMPLE seems to contain more functions than the LLVM IR.

This might be one of the causes of the difference in binary size.

@bjorn3
Copy link
Member

bjorn3 commented Jan 9, 2025

Note that the output of --emit llvm-ir is after optimizations unless you pass -Cno-prepopulate-passes.

Also is this with a sysroot compiled by cg_gcc rather than the default sysroot shipped with rustc? And if so did you make sure to enable release mode while compiling the sysroot? Also you probably have to pass -Zinline-mir given that you are building the sysroot with incr comp enabled. Incr comp disables MIR inlining by default. https://github.com/rust-lang/rustc_codegen_cranelift/blob/0335dc131fb35f710668f6e079d39eebbc31edac/build_system/build_sysroot.rs#L233-L236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants