-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
lto: load bitcode sections by name #115641
Conversation
Upstream change llvm/llvm-project@6b539f5 changed `isSectionBitcode` works and it now only respects `.llvm.lto` sections instead of also `.llvmbc`, which it says was never intended to be used for LTO. We instead load sections by name, and sniff for raw bitcode by hand. r? @nikic @rustbot label: +llvm-main
This is broken for me on macOS (M1, presumably also x86 but that machine is so slow to compile I didn't bother testing there). We look for __LLVM,__bitcode on macOS, but when I iterate the sections I see __text, __gcc_except_tab, __const, __const, __bitcode, __cmdline, __compact_unwind, __eh_frame. Should we be using __bitcode? |
Looking, it looks like the __LLVM prefix here is the "segment name" in the macho file, which is a concept unique to that format. I guess for this use case we'll detect-and-elide the __LLVM, prefix and that'll work for now, even if it's gross. |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (ffc48e3): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 627.243s -> 630.375s (0.50%) |
Upstream change
llvm/llvm-project@6b539f5 changed
isSectionBitcode
works and it now only respects.llvm.lto
sections instead of also.llvmbc
, which it says was never intended to be used for LTO. We instead load sections by name, and sniff for raw bitcode by hand.This is an alternative approach to #115136, where we tried the same thing using the
object
crate, but it got too fraught to continue.r? @nikic
@rustbot label: +llvm-main