diff options
| author | bors <bors@rust-lang.org> | 2020-05-21 07:16:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-05-21 07:16:44 +0000 |
| commit | 7f79e98c0356642db62e5113327e436c951e843d (patch) | |
| tree | b140158d00b7dfe9c34315a771816496adab9280 /src/test/codegen/align-struct.rs | |
| parent | 963bf528292d8f97104515e32908e30c2467b6a8 (diff) | |
| parent | f50986205756075fb05a9371b94facd58cc048a6 (diff) | |
| download | rust-7f79e98c0356642db62e5113327e436c951e843d.tar.gz rust-7f79e98c0356642db62e5113327e436c951e843d.zip | |
Auto merge of #72205 - ecstatic-morse:nrvo, r=oli-obk
Dumb NRVO This is a very simple version of an NRVO pass, which scans backwards from the `return` terminator to see if there is an an assignment like `_0 = _1`. If a basic block with two or more predecessors is encountered during this scan without first seeing an assignment to the return place, we bail out. This avoids running a full "reaching definitions" dataflow analysis. I wanted to see how much `rustc` would benefit from even a very limited version of this optimization. We should be able to use this as a point of comparison for more advanced versions that are based on live ranges. r? @ghost
Diffstat (limited to 'src/test/codegen/align-struct.rs')
| -rw-r--r-- | src/test/codegen/align-struct.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/codegen/align-struct.rs b/src/test/codegen/align-struct.rs index 5e290323907..cda7235a3d8 100644 --- a/src/test/codegen/align-struct.rs +++ b/src/test/codegen/align-struct.rs @@ -1,4 +1,4 @@ -// compile-flags: -C no-prepopulate-passes +// compile-flags: -C no-prepopulate-passes -Z mir-opt-level=0 // ignore-tidy-linelength #![crate_type = "lib"] |
