Skip to content
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

A couple PGO+BOLT limitations worth documenting? #26

Closed
mcronce opened this issue Nov 8, 2022 · 5 comments
Closed

A couple PGO+BOLT limitations worth documenting? #26

mcronce opened this issue Nov 8, 2022 · 5 comments

Comments

@mcronce
Copy link

mcronce commented Nov 8, 2022

In order to get PGO+BOLT working, I needed to

  • Switch from fat LTO to thin
  • Disable strip = "symbols" in my release profile
  • Use trunk LLVM (you already have this in the README, this is just to affirm that it's still needed - I was trying with the 15.0.4 tag previously)

Is it worth documenting those, and/or is there a way to make those settings work in RUSTFLAGS when you build the PGO-optimized binary that you're going to pass to llvm-bolt --instrument? The errors come from cc, which makes them super cryptic and unhelpful; I found the workarounds by just throwing possible fixes at the wall until something stuck 😂

I can retrigger the errors tonight if having a copy of them would be helpful

@mcronce
Copy link
Author

mcronce commented Nov 8, 2022

PS - thanks for the hard work on this! Your code in this repo and in the BOLT PRs for rustlang/rust are literally the only documentation I can find on using BOLT with Rust

@mcronce
Copy link
Author

mcronce commented Nov 8, 2022

Never mind the LTO bit; fat LTO is now not (even close to) worth the compile time hit to this project with the addition of BOLT, but it looks like it wasn't an actual blocking issue, only the strip piece and LLVM version were.

@Kobzol
Copy link
Owner

Kobzol commented Nov 9, 2022

Hi! Thanks for the useful information. In theory, cargo-pgo could detect symbol stripping/fat LTO and warn the user about it. With LLVM version, it's a bit more difficult, because it's probably impossible for the plugin to detect whether a specific LLVM version will work or not 😅

@Kobzol
Copy link
Owner

Kobzol commented Mar 21, 2023

I added a warning about stripping symbols when using BOLT to the README. Let me know if you think that I should document more things.

@mcronce
Copy link
Author

mcronce commented Mar 21, 2023

I think that gets the job done. Hopefully it saves somebody some time :)

@mcronce mcronce closed this as completed Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants