-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Figure out which LLVM optimisation passes are worth enabling #595
Comments
From jinyus/related_post_gen#440 (comment): using Perhaps as a starting point we can just set that option when using |
When using `inko build --opt=aggressive`, we not set LLVM's optimization level to "aggressive", which is the equivalent of -O3 for clang. This gives users to ability to have their code optimized at least somewhat, provided they're willing to deal with the significant increase in compile times. For example, Inko's test suite takes about 3 seconds to compile without optimizations, while taking just under 10 seconds when using --opt=aggressive. The option --opt=balanced still doesn't apply optimizations as we've yet to figure out which ones we want to explicitly opt-in to. See #595 for more details. Changelog: performance
1a30de9 changes |
At leas the following passes are worth looking into more, based on playing around with them to see what effect they have:
|
Worth adding: even with
On my laptop this takes 24 seconds to run, with about 80% of the time being spent in the code of I'm not sure how on earth this code is that slow, given that Rust does it in about 2.5 seconds. |
Curiously, the above program finishes in only 3.68 seconds on my desktop. Perhaps the Intel CPU on my laptop is just really terrible at this code for some reason? |
Depending on how LLVM decides to optimize things, these attributes may help improve code generation, though it's difficult to say for certain how much at this stage. See #595 for more details. Changelog: performance
Depending on how LLVM decides to optimize things, these attributes may help improve code generation, though it's difficult to say for certain how much at this stage. See #595 for more details. Changelog: performance
Depending on how LLVM decides to optimize things, these attributes may help improve code generation, though it's difficult to say for certain how much at this stage. See #595 for more details. Changelog: performance
Depending on how LLVM decides to optimize things, these attributes may help improve code generation, though it's difficult to say for certain how much at this stage. See #595 for more details. Changelog: performance
Depending on how LLVM decides to optimize things, these attributes may help improve code generation, though it's difficult to say for certain how much at this stage. See #595 for more details. Changelog: performance
Depending on how LLVM decides to optimize things, these attributes may help improve code generation, though it's difficult to say for certain how much at this stage. See #595 for more details. Changelog: performance
Right now the only optimisation pass we enable is the mem2reg pass, because that's pretty much a requirement for non-insane machine code. We deliberately don't use the O2/O3 options as they enable far too many optimisation passes, and don't give you the ability to opt-out of some of them (Swift takes a similar approach).
We should start collecting a list of what passes are worth enabling, and ideally what the compile time cost is versus the runtime improvement. The end goal is to basically enable the passes that give a decent amount of runtime performance improvements, but without slowing down compile times too much.
The text was updated successfully, but these errors were encountered: