I was wondering, do we have an understanding of the problems holding back the mir inliner? What will it take to get it stable? It seems like we could win a lot by having it. From what I can tell it seems to cause a lot of ICEs but I don't actually see that many issues on GH
ICEs are solved I think, afaik it's just that LLVM regresses perf by a lot if we turn it on
I can't find a tracking issue for this, but we have https://github.com/rust-lang/compiler-team/issues/281
ah so it's CGU partitioning again?
good thing we have #t-compiler/wg-incr-comp now :P
Damned CGUs XD
Question: the MIR inliner gave better performance still on full (ie non-incremental) builds, right?
Or was it also regressing in full builds?
(I ask because if it were regressing in full builds, then that means that there must be something besides CGU partitioning that's making it slower than not inlining)
full builds also do CGU partitioning
and yes, they also regressed
Oh, okay, I think I remember now what the CGU partitioning implied for full builds
deeply-nested also regressed like 10,000x in release mode because LLVM was able to do a lot more optimizations (at least that's my theory).
I was thinking only about the fact that in incremental you can change a lot of CGUs when recompiling
For those interested
But in full builds the size of the generated CGUs matters a lot, and since inlining should (think) raise the sizes, that's where it can regress
Oh god, those regressions
So Wesley: inlining should only be used for release mode, right?
Or should it be used in debug as well?
I dunno if LLVM inlines functions in debug mode
If it doesn't, then maybe the inlining opt only makes sense for release
(Because otherwise it wouldn't be taking work out of llvm)
(Forgot to tag you: @Wesley Wiser)
Arguably yeah it should only apply in release mode but there's a fair number of debug improvements as well. issue-46449-debug for example shows an almost 9% improvement on debug full.
I guess that means llvm applies inlining even on debug level?
Hang on I think I can check that with a playground :thinking:
No but inlining is a crucial optimization because it enables so many of the other optimizations to kick in.
That makes sense!
And with that you can overall give llvm better and crucially... smaller IR