Auto merge of #44249 - pnkfelix:debugflag-emit-end-regions, r=arielb1
Debugflag: -Z emit-end-regions Skip EndRegion emission by default. Use `-Z emit-end-regions` to reenable it. The main intent is to fix cases where `EndRegion` emission is believed to be causing excess peak memory pressure. It may also be a welcome change to people inspecting the MIR output who find the EndRegions to be a distraction. (In later follow-up PR's I will put in safe-guards against using the current mir-borrowck without enabling `EndRegion` emission. But I wanted this PR to be minimal, in part because we may wish to backport it to the beta channel if we find that it reduces peak memory usage significantly.)
This commit is contained in:
commit
d93036a043
15 changed files with 39 additions and 26 deletions
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -Z identify_regions
|
||||
// compile-flags: -Z identify_regions -Z emit-end-regions
|
||||
// ignore-tidy-linelength
|
||||
|
||||
// This is just about the simplest program that exhibits an EndRegion.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -Z identify_regions
|
||||
// compile-flags: -Z identify_regions -Z emit-end-regions
|
||||
// ignore-tidy-linelength
|
||||
|
||||
// We will EndRegion for borrows in a loop that occur before break but
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -Z identify_regions
|
||||
// compile-flags: -Z identify_regions -Z emit-end-regions
|
||||
// ignore-tidy-linelength
|
||||
|
||||
// Binding the borrow's subject outside the loop does not increase the
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -Z identify_regions
|
||||
// compile-flags: -Z identify_regions -Z emit-end-regions
|
||||
// ignore-tidy-linelength
|
||||
|
||||
// Unwinding should EndRegion for in-scope borrows: Direct borrows.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -Z identify_regions -Z span_free_formats
|
||||
// compile-flags: -Z identify_regions -Z span_free_formats -Z emit-end-regions
|
||||
// ignore-tidy-linelength
|
||||
|
||||
// Unwinding should EndRegion for in-scope borrows: Borrowing via by-ref closure.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -Z identify_regions -Z span_free_formats
|
||||
// compile-flags: -Z identify_regions -Z span_free_formats -Z emit-end-regions
|
||||
// ignore-tidy-linelength
|
||||
|
||||
// Unwinding should EndRegion for in-scope borrows: 2nd borrow within by-ref closure.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -Z identify_regions -Z span_free_formats
|
||||
// compile-flags: -Z identify_regions -Z span_free_formats -Z emit-end-regions
|
||||
// ignore-tidy-linelength
|
||||
|
||||
// Unwinding should EndRegion for in-scope borrows: Borrow of moved data.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -Z identify_regions -Z span_free_formats
|
||||
// compile-flags: -Z identify_regions -Z span_free_formats -Z emit-end-regions
|
||||
// ignore-tidy-linelength
|
||||
|
||||
// Unwinding should EndRegion for in-scope borrows: Move of borrow into closure.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -Z identify_regions -Z span_free_formats
|
||||
// compile-flags: -Z identify_regions -Z span_free_formats -Z emit-end-regions
|
||||
// ignore-tidy-linelength
|
||||
|
||||
// This test models a scenario that arielb1 found during review.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -Z identify_regions -Z span_free_formats
|
||||
// compile-flags: -Z identify_regions -Z span_free_formats -Z emit-end-regions
|
||||
// ignore-tidy-linelength
|
||||
|
||||
// Regression test for #43457: an `EndRegion` was missing from output
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue