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

Render call-graph #45

Open
matklad opened this issue Aug 29, 2021 · 1 comment
Open

Render call-graph #45

matklad opened this issue Aug 29, 2021 · 1 comment

Comments

@matklad
Copy link
Contributor

matklad commented Aug 29, 2021

Once again, ❤️ for building this, once again, in rust-lang/rust-analyzer#10065, llvm-lines was instrumental for getting rid of a major code bloat.

In that issue, llvm-lines quickly identified the leaf bloated functions, but it was not obvious why those monomorphisations are there (indeed, they turned out to be dead code). To figure that out, I used a manual workflow of ctrl+F in the .ll file to follow call-chains of suspicious functions backwards, until I found the root cause of extra monomorphisations (in my case, drop method in trait objects vtable).

It would be very cool If I could somehow automate this process. I think cargo-llvm-lines could easily build a static call-graph between all monomorphizations.

I have no idea how to visualize that information in a convenient way though :(

@matklad
Copy link
Contributor Author

matklad commented Aug 29, 2021

Ended up writing ad-hoc code to follow call chains: https://github.com/matklad/llcg

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

1 participant