Stream: t-compiler/wg-mir-opt

Topic: hello

Welcome Bot (Mar 04 2019 at 16:46, on Zulip):

Welcome to #t-compiler/wg-mir-opt.

Description: Working group focused on implementing MIR optimizations and refactoring the MIR to be more amenable to optimizations

davidtwco (Mar 04 2019 at 16:47, on Zulip):

@WG-mir-opt exists too.

oli (Mar 04 2019 at 16:48, on Zulip):

thanks! Do I have to keep that tag in sync with the github team?

davidtwco (Mar 04 2019 at 16:48, on Zulip):

For now, yeah. Hopefully at some point the rust-lang/team repository will handle that too (I think Zulip would need to add an API for it).

oli (Mar 04 2019 at 16:49, on Zulip):

Ok, so I should be bugging you or others with powers to add ppl? Or is this something I should do myself?

davidtwco (Mar 04 2019 at 16:50, on Zulip):

I think you should be able to add people. Try making a change, Organization Settings > User Groups, then just try add and remove yourself.

davidtwco (Mar 04 2019 at 16:51, on Zulip):

Otherwise, feel free to ping me.

oli (Mar 04 2019 at 16:52, on Zulip):

wonderful, that works, thanks!

FĂ©lix Fischer (Mar 11 2019 at 01:11, on Zulip):

Hello y'alls!

davidtwco (Mar 11 2019 at 10:44, on Zulip):

Would someone be able to add me to the GitHub group for this WG? I'm interested in contributing to it once it kicks off.

oli (Mar 11 2019 at 11:34, on Zulip):

huh? you can't add yourself? Our permission scheme is funky. I can add you on github, but can't edit things here, you can edit things here but not on github?

oli (Mar 11 2019 at 11:34, on Zulip):

added you

davidtwco (Mar 11 2019 at 11:35, on Zulip):

Thanks. I don't have any permissions on GitHub outside of basic labelling and assigning AFAIK.

Wesley Wiser (Mar 11 2019 at 14:44, on Zulip):

I'm also very interested in contributing once it kicks off :smile:

Saleem Jaffer (Apr 24 2019 at 05:33, on Zulip):

Hey @oli I would like to do some work in MIR. Do let me know if I can help out!

oli (Apr 24 2019 at 08:14, on Zulip):

awesome! We'll gladly take your help

oli (Apr 24 2019 at 08:15, on Zulip):

If you want to pick up something that just needs carrying over the finish line, is pretty cool, MIR related and just needs some finishing cleanups

Saleem Jaffer (Apr 24 2019 at 09:08, on Zulip):

Cool, I'll take it up!

Yuki Okushi (May 02 2019 at 02:59, on Zulip):

Hi everyone! I've got very interested in miri during the course of making a PR. Could I work on the issues as a member of this WG? cc @oli

oli (May 02 2019 at 07:08, on Zulip):

This WG is about changing MIR datastructures and adding MIR optimizations, if you are looking for MIR interpretation, we don't have a working group for that (yet?).

Yuki Okushi (May 02 2019 at 11:08, on Zulip):

@oli Yes, I read this README. I would be glad if I could help to solve some issues!

oli (May 02 2019 at 11:25, on Zulip):

wonderful! We're happy to have you then. I'll add you to the github team

oli (May 02 2019 at 11:26, on Zulip):

nevermind XD I don't have permissions to do that

oli (May 02 2019 at 11:26, on Zulip):

I'll bring it up with the appropriate ppl and just add you to the zulip team for now

Yuki Okushi (May 02 2019 at 11:32, on Zulip):

Thank you!

Saleem Jaffer (May 03 2019 at 12:42, on Zulip):

@oli Is there a place where the team for the MIR WG exists? If so, could you please add me to that?

oli (May 05 2019 at 14:54, on Zulip):

@Saleem Jaffer do you mean ?

Saleem Jaffer (May 05 2019 at 15:05, on Zulip):

@oli yeah looks like. Do we specifically add people into this?

oli (May 05 2019 at 15:06, on Zulip):

I don't think so, but you can look at what other teams are doing

Santiago Pastorino (May 06 2019 at 13:53, on Zulip):

what is usually done is adding people to the Zulip group so when you do @WG-mir-opt more people can be notified

oli (May 06 2019 at 15:36, on Zulip):

that has already happened

oli (May 06 2019 at 15:37, on Zulip):

we're working on a system to do that on github easily, too

Santiago Pastorino (May 06 2019 at 15:38, on Zulip):

what I meant is ... maybe @Saleem Jaffer can be added there

oli (May 06 2019 at 16:02, on Zulip):

yes, they have been added to the zulip group

Saleem Jaffer (May 15 2019 at 09:00, on Zulip):

@oli I can pick up some more work in MIR

oli (May 16 2019 at 12:56, on Zulip):

@Saleem Jaffer there's if you want it

Emanuel Lima (Feb 07 2020 at 20:52, on Zulip):

Hello @oli , @Wesley Wiser , @Santiago Pastorino

My first question is how can I best contribute, seeing that I am still a beginner on the compiler world.

Second, do you guys have recomendations of books or talks that I can use to study?

Wesley Wiser (Feb 07 2020 at 20:55, on Zulip):

Welcome! :slight_smile:

Wesley Wiser (Feb 07 2020 at 20:56, on Zulip):

Do you have any experience with writing Rust code already?
Contributors of all experience levels are welcome but it's helpful for me to give you better resource suggestions.

Emanuel Lima (Feb 07 2020 at 20:58, on Zulip):

I would say that my Rust is basic. I've written small to medium programs in the past using a blockchain framework called Substrate. But it never got past the prototype phase.

Wesley Wiser (Feb 07 2020 at 20:58, on Zulip):

Ok, great!

Wesley Wiser (Feb 07 2020 at 21:00, on Zulip):

One of the main resources I would point you to is the "rustc-guide" which is a non-exhaustive document that describes how the rust compiler works.

Santiago Pastorino (Feb 07 2020 at 21:00, on Zulip):

Hello oli , Wesley Wiser , Santiago Pastorino

My first question is how can I best contribute, seeing that I am still a beginner on the compiler world.

Second, do you guys have recomendations of books or talks that I can use to study?


Wesley Wiser (Feb 07 2020 at 21:00, on Zulip):

In particular, this overview is helpful

Wesley Wiser (Feb 07 2020 at 21:00, on Zulip):

And then all of the pages under "2.17: The MIR" are helpful

Emanuel Lima (Feb 07 2020 at 21:02, on Zulip):


Wesley Wiser (Feb 07 2020 at 21:07, on Zulip):

Sometimes it's helpful to see an example of something in code. This is a pretty recent PR that added a new optimization pass so it should give you an idea of what that looks like:

Wesley Wiser (Feb 07 2020 at 21:09, on Zulip):

Unfortunately I don't know of any good beginner issues I could point you towards at the moment. However @oli may have some ideas. He's in Europe so he probably won't chime in until tomorrow.

Wesley Wiser (Feb 07 2020 at 21:10, on Zulip):

I'd encourage you to look at the rustc-guide and also try building a copy of the compiler on your computer.

Wesley Wiser (Feb 07 2020 at 21:10, on Zulip):

The first time you compile often takes a very long time and nothing is worse than wanting to jump into making a change and then having to wait for a really long compile.

Emanuel Lima (Feb 07 2020 at 21:15, on Zulip):

Noted! Thanks for the directions.

oli (Feb 08 2020 at 08:09, on Zulip):

hi! One thing that we're going to look into soonish is to have different mir opt levels for different regular optimization levels. Some optimizations are too expensive for debug mode or will make debugging hard/impossible. So maybe that could be a good start?

eddyb (Feb 08 2020 at 09:06, on Zulip):

will make debugging hard/impossible

this shouldn't be a thing. perfect debuginfo preservation was the blocker for my SROA and NRVO optimizations

eddyb (Feb 08 2020 at 09:26, on Zulip):

please talk to me about things like that, I think one of the goals is (or used to be?) that optimized libraries should still be "perfectly debuggable" (although this mostly matters for libcore...libstd)

eddyb (Feb 08 2020 at 09:27, on Zulip):

although idk if this topic is the best one to discuss this in lol

Zoxc (Feb 08 2020 at 10:12, on Zulip):

Perfect debuginfo preservation limits optimizations though =P

eddyb (Feb 08 2020 at 11:17, on Zulip):

@Zoxc common misconception :P

eddyb (Feb 08 2020 at 11:17, on Zulip):

AFAICT you might even be able to run a loop to compute a value in the debugger, which was completely optimized out in the actual program

eddyb (Feb 08 2020 at 11:18, on Zulip):

one of the main limiting factors here is LLVM

eddyb (Feb 08 2020 at 11:20, on Zulip):

(I suggest everyone in wg-mir-opt to skim through - I wish I've done it years ago, it's really inspiring to see what's designed to be possible)

bjorn3 (Feb 08 2020 at 11:24, on Zulip):

I have read a lot of that document already to implement debuginfo in cg_clif. It can be hard to find what you want, but it is likely there, no matter how exotic it is what you want.

eddyb (Feb 08 2020 at 11:25, on Zulip):

I'm kind of curious how you're approaching DWARF, is there some Cranelift abstraction being built by you or anyone else? (presumably you need to map Cranelift instructions to address ranges you can write in the DWARF)

eddyb (Feb 08 2020 at 11:25, on Zulip):

(but this is very offtopic lol)

bjorn3 (Feb 08 2020 at 11:43, on Zulip):

Cranelift has a few basic abstractions like:

On top of those I have built a DWARF writer which uses gimli for the actual encoding. (

oli (Feb 08 2020 at 15:50, on Zulip):

OK, rolling back on the debug info thing since the other thread says we can do that correctly.

oli (Feb 08 2020 at 15:51, on Zulip):

I'd still thunk there are optimizations that are too expensive. I've read somewhere that copy prop is expensive? Not sure what the status on that is

eddyb (Feb 08 2020 at 15:52, on Zulip):

copy prop... isn't great

eddyb (Feb 08 2020 at 15:52, on Zulip):

I hope to make a cheap single-pass-ish version of my NRVO optimization that still handles many of the cases

eddyb (Feb 08 2020 at 16:03, on Zulip):

(okay, no, it would be two passes roughly, to account for ever-borrowed locals)

Wesley Wiser (Feb 13 2020 at 16:30, on Zulip):

@Emanuel Lima If you're still looking for something to do, #69134 might be a good beginner issue that will involve working with the backend of the compiler.

Emanuel Lima (Feb 13 2020 at 17:05, on Zulip):

I'll check it out!

Antoine Martin (Jul 13 2020 at 10:01, on Zulip):

hi ! came here from this tweet :)

I don't have any specific optimization I'd like to tackle, mostly because I have no idea of what currently gets optimized in rustc. Would love a small task to get started working on rustc :)

Wesley Wiser (Jul 13 2020 at 10:17, on Zulip):

Welcome! cc @oli in case they have something in mind to get you started

oli (Jul 13 2020 at 10:23, on Zulip):

Hi and welcome! Let's talk in

Xavier Denis (Jul 13 2020 at 10:31, on Zulip):

if you have some other issues that need hands let me know! I'd like to help out where I can

oli (Jul 13 2020 at 10:37, on Zulip):

We have a moderate list but I need to pick out good entry level optimizations. It's not like most of them are really hard per se, but if you have to learn rustc contribution and mir optimizations at the same time, it's better to start with something that isn't gonna be a 4 week rabbit hole

choco (Jul 13 2020 at 17:29, on Zulip):

Hello everyone, I also came from the tweet that @oli made, so if there's something to gets my hands dirty I'm down!

Lokathor (Jul 13 2020 at 23:19, on Zulip):

also came from the tweet

Last update: Sep 27 2020 at 14:00UTC