Skip to content

[Topic]: MIR Analyses #10

Closed
Closed
@felix91gr

Description

@felix91gr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions