Stream: t-compiler/wg-mir-opt

Topic: Joining


Nathan Corbyn (Jun 08 2020 at 12:03, on Zulip):

Hello! I've suddenly got a lot of time on my hands and I'd really like to get more involved in rustc. The rustc dev guide suggested joining a wg and mir opt is something I'm particularly interested in (although my knowledge of mir is very limited). Are there any issues that are a good place for me to start?

Jonas Schievink (Jun 08 2020 at 12:06, on Zulip):

Welcome! This one I filed a few days ago should be fairly straightforward: https://github.com/rust-lang/rust/issues/72959

Nathan Corbyn (Jun 08 2020 at 12:07, on Zulip):

Awesome! I'll have a look :)

Jonas Schievink (Jun 08 2020 at 12:19, on Zulip):

Something else that would be fairly useful would be documenting the MIR invariants that the validator and Miri are enforcing as doc comments on the MIR types themselves

Nathan Corbyn (Jun 08 2020 at 12:21, on Zulip):

I can definitely have a look at that as well

Nathan Corbyn (Jun 08 2020 at 12:22, on Zulip):

For unwind blocks I think this is already the case

Nathan Corbyn (Jun 08 2020 at 12:22, on Zulip):

(As in the invariant is documented, but it's not yet enforced)

Nathan Corbyn (Jun 08 2020 at 12:56, on Zulip):

I had a quick look (#73133) some feedback on how to write tests/if this is the right idea would be amazing

oli (Jun 08 2020 at 14:15, on Zulip):

unfortunately we have no way to generate arbitrary MIR, but we'd like to have: https://github.com/rust-lang/miri/issues/196

oli (Jun 08 2020 at 14:16, on Zulip):

without a way to generate abitrary MIR, you can't test for broken MIR, as rustc should not be emitting broken MIR

oli (Jun 08 2020 at 14:17, on Zulip):

note that your validation checks seem to have found a bug in the MIR building phase

Jonas Schievink (Jun 08 2020 at 14:18, on Zulip):

You can also set RUSTFLAGS_NOT_BOOTSTRAP=-Zvalidate-mir to run the validator after every MIR transformation. This should give you a good idea of whether some pass produces broken MIR.

Nathan Corbyn (Jun 08 2020 at 14:54, on Zulip):

Ok, thanks a lot! I'll investigate the breakage (just want to check should all edges between cleanup blocks be unwind?)

Jonas Schievink (Jun 08 2020 at 14:56, on Zulip):

No, they can also have normal edges

Jonas Schievink (Jun 08 2020 at 14:56, on Zulip):

But once in a cleanup block you can never go back to a non-cleanup block

Nathan Corbyn (Jun 08 2020 at 14:57, on Zulip):

Ok got it!

Nathan Corbyn (Jun 08 2020 at 15:00, on Zulip):

With that relaxation the validation seems to pass fine

Matthew Jasper (Jun 08 2020 at 15:00, on Zulip):

Edges between cleanup blocks should only be normal edges.

Jonas Schievink (Jun 08 2020 at 15:01, on Zulip):

Ah, right

Matthew Jasper (Jun 08 2020 at 15:01, on Zulip):

Panicking in cleanup aborts

oli (Jun 08 2020 at 15:02, on Zulip):

should this use a dataflow algorithm?

oli (Jun 08 2020 at 15:03, on Zulip):

any custom algorithm would have to basically replicate dataflow I think

Matthew Jasper (Jun 08 2020 at 15:04, on Zulip):

We mark which blocks are cleanup. There's no need for dataflow.

Nathan Corbyn (Jun 08 2020 at 15:04, on Zulip):

Ok that's an easy fix - I don't think it needs data-flow

RalfJ (Jun 20 2020 at 11:47, on Zulip):

Jonas Schievink said:

You can also set RUSTFLAGS_NOT_BOOTSTRAP=-Zvalidate-mir to run the validator after every MIR transformation. This should give you a good idea of whether some pass produces broken MIR.

oh thats how you do that :D

Last update: Jan 22 2021 at 13:15UTC