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

[Topic]: MIR Analyses #10

Closed
1 task done
felix91gr opened this issue Oct 28, 2021 · 1 comment
Closed
1 task done

[Topic]: MIR Analyses #10

felix91gr opened this issue Oct 28, 2021 · 1 comment

Comments

@felix91gr
Copy link

Contact Details

felix91gr@gmail.com

Which rustc topic would you like to suggest?

MIR Analysis (and in particular, Dataflow based analysis) is a very important topic to me, but I had a hard time getting around the code itself and the little bits and pieces when I tried making NL(CP) happen. Now I've put this project on hiatus (as of about 3 weeks ago, I've cancelled my thesis which was based on that work c': ), and because of uni I'm not gonna get back at it full steam until I'm able to graduate.

I would like to understand... okay, so this is the current picture I have in my mind of how the compiler processes code:


Text ==> Rust ==> HIR ==> <<MIR>> || Frontend-Backend boundary || ==> <<LLVM>> ==> Binary

Where <<bloop>> means the bloop stage loops back into itself many times

And inside of that...

  • Rust ==> HIR simplifies rust code (and does macro expansion?)
  • <<MIR>> makes high-level analyses and transforms such as... non-lexical lifetime analysis, (trait resolution?) and high-level optimizations.

The thing is, I would love to understand how we perform everything inside <<MIR>>. It's a very important topic for me. Both because it helps Clippy, which can help attest for program correctness... and because it helps reduce compile times and it will one day help us optimize beyond what LLVM alone can give us.

And, maybe this is just me or maybe I'm just code-shy, but I feel like my theoretical understanding of some of the program analysis topics is good enough for where the compiler's at. Yet it's still super hard for me to step at a point in rustc's MIR Analysis code and know what's up, let alone draft new code to add to it. That's what I would like to learn the most: how to be confident enough with the compiler's code so that I could give back to it from my harvests.

Relevant code file URL

Code of Conduct

  • I agree to follow this project's Code of Conduct
@doc-jones
Copy link
Contributor

This is an amazing write up. It also appears to be beyond the scope of our code reading club sessions. We will be focusing on understanding the modules or crates that makeup the compiler and maybe even resolving a real bug.

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