I'm looking at the generated assembly code for std.rc (which is now compiling, although it fails to link due to a strange mangling LLVM is performing on duplicate native symbols). Even with all of LLVM's optimizations, our hash insertion code has 4x the instruction count of that of glib.

One major reason for this is that we have enormous overhead when calling upcalls like get_type_desc() and size_of(). These calls are completely opaque to LLVM. Even if we fixed the crate-relative encoding issues, these calls would still be opaque to LLVM.

Most upcalls are trivial (get_type_desc() is an exception; I don't know why it needs to exist, actually). For those, it would be great to inline them. To do that, we need LTO, which basically means that we compile rustrt with clang and link the resulting .bc together with the .bc that rustc yields before doing LLVM's optimization passes. I think this would be a huge win; we would remove all the upcall glue and make these low-level calls, of which there are quite a lot, no longer opaque to LLVM.

Thoughts?

Patrick
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to