Skip to content

feat: MIR episode 5#14787

Merged
bors merged 1 commit intorust-lang:masterfrom
HKalbasi:mir2
May 18, 2023
Merged

feat: MIR episode 5#14787
bors merged 1 commit intorust-lang:masterfrom
HKalbasi:mir2

Conversation

@HKalbasi
Copy link
Copy Markdown
Member

This PR inits drop support (it is very broken at this stage, some things are dropped multiple time, drop scopes are wrong, ...) and adds stdout support (println! doesn't work since its expansion is dummy, but stdout().write(b"hello world\n") works if you use RA_SYSROOT_HACK) for interpreting. There is no useful unit test that it can interpret yet, but it is a good sign that it didn't hit a major road block yet.

In MIR lowering, it adds support for slice pattern and anonymous const blocks, and some fixes so that we can evaluate SmolStr::new_inline in const eval. With these changes, 57 failed mir body remains.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 12, 2023
Comment thread crates/hir-def/src/db.rs Outdated
Comment thread crates/hir-def/src/lib.rs Outdated
@HKalbasi
Copy link
Copy Markdown
Member Author

@bors r+

@bors
Copy link
Copy Markdown
Contributor

bors commented May 18, 2023

📌 Commit cbcafd3 has been approved by HKalbasi

It is now in the queue for this repository.

@bors
Copy link
Copy Markdown
Contributor

bors commented May 18, 2023

⌛ Testing commit cbcafd3 with merge 034d7c8...

@bors
Copy link
Copy Markdown
Contributor

bors commented May 18, 2023

☀️ Test successful - checks-actions
Approved by: HKalbasi
Pushing 034d7c8 to master...

@bors bors merged commit 034d7c8 into rust-lang:master May 18, 2023
@HKalbasi
Copy link
Copy Markdown
Member Author

HKalbasi commented May 18, 2023

This broke something. I'm on it. No it was #14820

@lnicola lnicola changed the title MIR episode 5 feat: MIR episode 5 May 18, 2023
@Veykril
Copy link
Copy Markdown
Member

Veykril commented May 18, 2023

This increased memory usage on self by 200mb

@lnicola
Copy link
Copy Markdown
Member

lnicola commented May 18, 2023

I think that's because we're including MIR in the measurement? There was a big increase when we added it to analysis-stats, too.

@Veykril
Copy link
Copy Markdown
Member

Veykril commented May 18, 2023

Yes it is, but that will still accumulate for users over time since we build MIR for all opened files for diagnostics so it is something to keep in mind here. We might wanna LRU some of the queries there.

Also on another note, some PR (I imagine either this one or the change of format_args from lazy to eager) caused a bunch of unknown types for r-a, we went from 34 to 83

@Veykril
Copy link
Copy Markdown
Member

Veykril commented May 18, 2023

Needless to say we need to do something about memory usage now again as this is quite a big increase overall now over the past month.

@HKalbasi
Copy link
Copy Markdown
Member Author

This PR added many Drop blocks to mir, that probably explain the increase.

There are many low hanging fruit in optimizing memory of mir I guess. It doesn't even shrink_to_fit the mir body query.

@homersimpsons
Copy link
Copy Markdown
Contributor

This increased memory usage on self by 200mb

For the record, this was reduced back to normal with #14847

@HKalbasi
Copy link
Copy Markdown
Member Author

Not really, the increase of #14843 should be attributed to this PR as well. But I still see some low hanging fruits in MIR memory usage, it is not done yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants