-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
replace type_use with LLVM's mergefunc pass #9222
Comments
We also have to figure out where exactly to run If we run it early, we'll save on compile-time, and if we run it after optimizations we'll save more on code size. I'm sure how much |
Can we run it twice? |
Yes, but it might be too expensive. |
It now works well enough for |
This is broken, and results in poor performance due to the undefined behaviour in the LLVM IR. LLVM's `mergefunc` is a *much* better way of doing this since it merges based on the equality of the bytecode. For example, consider `std::repr`. It generates different code per type, but is not included in the type bounds of generics. The `mergefunc` pass works for most of our code but currently hits an assert on libstd. It is receiving attention upstream so it will be ready soon, but I don't think removing this broken code should wait any longer. I've opened #9536 about enabling it by default. Closes #8651 Closes #3547 Closes #2537 Closes #6971 Closes #9222
unwrap_used: Don't recommend using `expect` when the `expect_used` lint is not allowed Fixes rust-lang#9222 ``` changelog: [`unwrap_used`]: Don't recommend using `expect` when the `expect_used` lint is not allowed ```
The
type_use
implementation is buggy, leading to nightmarish code generation errors. Themergefunc
pass will be strictly better in terms of code size reduction since it compares equality of the function bytecode after normalizing it. I think it will catch nearly every valid case we currently do withtype_use
, if not all.We should drop the maintenance burden as soon as we get
mergefunc
working (or sooner) and revisit it as a potential compile-time optimization in the future.The text was updated successfully, but these errors were encountered: