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

Add -Z skip-end-regions as way to side-step EndRegion emission. #44219

Closed

Conversation

pnkfelix
Copy link
Member

Add -Z skip-end-regions as way to side-step EndRegion emission.

The main intent is to investigate cases where EndRegion emission is believed to be causing excess peak memory pressure.

It may also be of use to people inspecting the MIR output who find the EndRegions to be a distraction.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@@ -48,9 +49,13 @@ impl<'tcx> CFG<'tcx> {
block: BasicBlock,
source_info: SourceInfo,
extent: CodeExtent) {
self.push(block, Statement {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you pass the tcx here instead of using TLS? Using TLS like that is kind of an anti-pattern.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I considered this and rejected it (based on a fear of having to thread tcx up a long method chain), but looking at it now I don't know why I came to that conclusion, since the Builder in scope.rs carries a hair::cx::Cx...

Will fix.

The main intent is to investigate cases where EndRegion emission is
believed to be causing excess peak memory pressure.

It may also be of use to people inspecting the MIR output who find the
EndRegions to be a distraction.

----

(commit is now updated to thread the tcx down instead of consulting
thread-local storage for it.)
@pnkfelix pnkfelix force-pushed the debugflag-skip-end-regions branch from cd27c30 to 051601e Compare August 31, 2017 20:55
@pnkfelix
Copy link
Member Author

pnkfelix commented Sep 1, 2017

Closing in favor of #44249

@pnkfelix pnkfelix closed this Sep 1, 2017
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

Successfully merging this pull request may close these issues.

4 participants