about summary refs log tree commit diff
path: root/src/test/mir-opt
AgeCommit message (Collapse)AuthorLines
2021-06-20Squashed implementation of the passAlex Vlasov-0/+77
2021-06-12Pretty print generator witness only in `-Zverbose` modeTomasz Miąsko-13/+13
In release build of deeply-nested-async benchmark the size of `no-opt.bc` file is reduced from 46MB to 62kB.
2021-06-12Rollup merge of #86153 - tmiasko:dummy-span, r=estebankYuki Okushi-8/+8
Print dummy spans as `no-location` Fixes #58808.
2021-06-09Auto merge of #86107 - Smittyvb:peephole-optim-eq-bool, r=wesleywiserbors-0/+166
Peephole optimize `x == false` and `x != true` This adds peephole optimizations to make `x == false`, `false == x`, `x != true`, and `true != x` get optimized to `!x` in the `instcombine` MIR pass. That pass currently handles `x == true` -> `x` already.
2021-06-09Print dummy spans as `no-location`Tomasz Miąsko-8/+8
2021-06-07Peephole optimize `x == false` and `x != true`Smitty-0/+166
2021-06-07Revert "Update mir opt tests"bjorn3-24/+24
This reverts commit e0e0cfa6492292d0b905b07a4ed727f4e1aefc80.
2021-05-30Update mir opt testsbjorn3-24/+24
2021-05-26Bless test outputJacob Pratt-9/+16
2021-05-23unhinabited_enum_branching: Fix the pass when the enum is taken indirectlyOlivier Goffart-62/+14
If there is a projection on the place of the discriminent, the pass wouldn't trigger
2021-05-23Test for unihnabitded_enum_branching pass using reference to fieldsOlivier Goffart-0/+348
2021-05-18Auto merge of #84767 - scottmcm:try_trait_actual, r=lcnrbors-344/+330
Implement the new desugaring from `try_trait_v2` ~~Currently blocked on https://github.com/rust-lang/rust/issues/84782, which has a PR in https://github.com/rust-lang/rust/pull/84811~~ Rebased atop that fix. `try_trait_v2` tracking issue: https://github.com/rust-lang/rust/issues/84277 Unfortunately this is already touching a ton of things, so if you have suggestions for good ways to split it up, I'd be happy to hear them. (The combination between the use in the library, the compiler changes, the corresponding diagnostic differences, even MIR tests mean that I don't really have a great plan for it other than trying to have decently-readable commits. r? `@ghost` ~~(This probably shouldn't go in during the last week before the fork anyway.)~~ Fork happened.
2021-05-18No matter how trivial the change, tidy always finds a way to complain...Scott McMurray-4/+4
2021-05-18Mention the issue number for the new mir-opt in the FIXMEs scottmcm-2/+2
Thanks for the suggestions, lcnr! Co-authored-by: lcnr <rust@lcnr.de>
2021-05-17mir-opt bless for Size field being removed from AllocationRalf Jung-44/+44
2021-05-09PR feedbackScott McMurray-8/+8
2021-05-07array-to-raw-elem cast: test that Retag covers entire arrayRalf Jung-18/+241
2021-05-06mir-opt & codegen test updatesScott McMurray-344/+330
`SimplifyArm` and such are currently in `-Zunsound-mir-opts` and thus weren't running by default, so having something like them for the new desugar shouldn't be necessary for switching.
2021-04-05Rollup merge of #83807 - sjakobi:77548-remove-ignore-annotations, ↵Dylan DPC-410/+409
r=Mark-Simulacrum Tests: Remove redundant `ignore-tidy-linelength` annotations This is step 2 towards fixing #77548. In the codegen and codegen-units test suites, the `//` comment markers were kept in order not to affect any source locations. This is because these tests cannot be automatically `--bless`ed.
2021-04-03Remove redundant `ignore-tidy-linelength` annotationsSimon Jakobi-410/+409
This is step 2 towards fixing #77548. In the codegen and codegen-units test suites, the `//` comment markers were kept in order not to affect any source locations. This is because these tests cannot be automatically `--bless`ed.
2021-04-02Fix diagnostic issue when using FakeReads in closuresRoxane-51/+51
2021-03-31Make unevaluated DefId rendering deterministicOli Scherer-22/+22
2021-03-27Auto merge of #78618 - workingjubilee:ieee754-fmt, r=m-ou-sebors-1/+1
Add IEEE 754 compliant fmt/parse of -0, infinity, NaN This pull request improves the Rust float formatting/parsing libraries to comply with IEEE 754's formatting expectations around certain special values, namely signed zero, the infinities, and NaN. It also adds IEEE 754 compliance tests that, while less stringent in certain places than many of the existing flt2dec/dec2flt capability tests, are intended to serve as the beginning of a roadmap to future compliance with the standard. Some relevant documentation is also adjusted with clarifying remarks. This PR follows from discussion in https://github.com/rust-lang/rfcs/issues/1074, and closes #24623. The most controversial change here is likely to be that -0 is now printed as -0. Allow me to explain: While there appears to be community support for an opt-in toggle of printing floats as if they exist in the naively expected domain of numbers, i.e. not the extended reals (where floats live), IEEE 754-2019 is clear that a float converted to a string should be capable of being transformed into the original floating point bit-pattern when it satisfies certain conditions (namely, when it is an actual numeric value i.e. not a NaN and the original and destination float width are the same). -0 is given special attention here as a value that should have its sign preserved. In addition, the vast majority of other programming languages not only output `-0` but output `-0.0` here. While IEEE 754 offers a broad leeway in how to handle producing what it calls a "decimal character sequence", it is clear that the operations a language provides should be capable of round tripping, and it is confusing to advertise the f32 and f64 types as binary32 and binary64 yet have the most basic way of producing a string and then reading it back into a floating point number be non-conformant with the standard. Further, existing documentation suggested that e.g. -0 would be printed with -0 regardless of the presence of the `+` fmt character, but it prints "+0" instead if given such (which was what led to the opening of #24623). There are other parsing and formatting issues for floating point numbers which prevent Rust from complying with the standard, as well as other well-documented challenges on the arithmetic level, but I hope that this can be the beginning of motion towards solving those challenges.
2021-03-24RemoveZsts: don't touch unionsErik Desjardins-0/+32
2021-03-23Auto merge of #83177 - erikdesjardins:zstassign, r=oli-obkbors-124/+91
Remove assignments to ZST places instead of marking ZST return place as unused partially reverts #83118 requested by `@tmiasko` in https://github.com/rust-lang/rust/pull/83118#issuecomment-799692574 r? `@oli-obk`
2021-03-22Preserve signed zero on roundtripJubilee Young-1/+1
This commit removes the previous mechanism of differentiating between "Debug" and "Display" formattings for the sign of -0 so as to comply with the IEEE 754 standard's requirements on external character sequences preserving various attributes of a floating point representation. In addition, numerous tests are fixed.
2021-03-22only run RemoveZsts at mir-opt-level 3 and aboveErik Desjardins-16/+40
2021-03-22Auto merge of #79278 - mark-i-m:stabilize-or-pattern, r=nikomatsakisbors-86/+83
Stabilize or_patterns (RFC 2535, 2530, 2175) closes #54883 This PR stabilizes the or_patterns feature in Rust 1.53. This is blocked on the following (in order): - [x] The crater run in https://github.com/rust-lang/rust/pull/78935#issuecomment-731564021 - [x] The resolution of the unresolved questions and a second crater run (https://github.com/rust-lang/rust/pull/78935#issuecomment-735412705) - It looks like we will need to pursue some sort of edition-based transition for `:pat`. - [x] Nomination and discussion by T-lang - [x] Implement new behavior for `:pat` based on consensus (https://github.com/rust-lang/rust/pull/80100). - [ ] An FCP on stabilization EDIT: Stabilization report is in https://github.com/rust-lang/rust/pull/79278#issuecomment-772815177
2021-03-20bless mir-opt testslcnr-44/+44
2021-03-19update testsmark-86/+83
2021-03-18Mark early otherwise optimization unsoundSantiago Pastorino-2/+2
2021-03-17Auto merge of #82122 - bstrie:dep4real, r=dtolnaybors-15/+15
Deprecate `intrinsics::drop_in_place` and `collections::Bound`, which accidentally weren't deprecated Fixes #82080. I've taken the liberty of updating the `since` values to 1.52, since an unobservable deprecation isn't much of a deprecation (even the detailed release notes never bothered to mention these deprecations). As mentioned in the issue I'm *pretty* sure that using a type alias for `Bound` is semantically equivalent to the re-export; [the reference implies](https://doc.rust-lang.org/reference/items/type-aliases.html) that type aliases only observably differ from types when used on unit structs or tuple structs, whereas `Bound` is an enum.
2021-03-16bless testsErik Desjardins-38/+38
2021-03-15bless testsErik Desjardins-184/+127
2021-03-14bless tests (32-bit)Erik Desjardins-25/+17
2021-03-13bless testsErik Desjardins-27/+17
2021-03-13Move ZST check inside UsedLocalsSimon Vandel Sillesen-0/+1
2021-03-13Extend SimplifyLocals to remove ZST writesSimon Vandel Sillesen-37/+11
2021-03-09Deprecate items that accidentally weren't deprecatedbstrie-15/+15
Fixes #82080
2021-03-09Allow calling *const methods on *mut valuesÖmer Sinan Ağacan-0/+116
Fixes #80258
2021-03-06Disable destination propagation on all mir-opt-levelsTomasz Miąsko-147/+255
2021-03-05Bump mir-opt-level from 2 to 3 in testsSantiago Pastorino-5/+5
2021-03-05Bump mir-opt-level from 3 to 4 in testsSantiago Pastorino-9/+9
2021-02-28Remove storage markers if they won't be used during code generationTomasz Miąsko-0/+126
The storage markers constitute a substantial portion of all MIR statements. At the same time, for builds without any optimizations, the storage markers have no further use during and after MIR optimization phase. If storage markers are not necessary for code generation, remove them.
2021-02-22New mir-opt pass to simplify gotos with const valuesSimon Vandel Sillesen-355/+482
Fixes #77355
2021-02-21New pass to deduplicate blocksSimon Vandel Sillesen-1/+115
2021-02-21Make MatchBranchSimplification clean up after itselfSimon Vandel Sillesen-246/+222
2021-02-14Apply suggestionsBenoît du Garreau-63/+95
- Move `assert_failed` to core::panicking` - Make `assert_failed` use an enum instead of a string
2021-02-14Apply suggestionBenoît du Garreau-7/+13
2021-02-14Fix UI tests and merge `assert_eq` and `assert_ne` internal functionsBenoît du Garreau-642/+114