rust/tests
bors 6db1e5e771 Auto merge of #111010 - scottmcm:mem-replace-simpler, r=WaffleLapkin
Make `mem::replace` simpler in codegen

Since they'd mentioned more intrinsics for simplifying stuff recently,
r? `@WaffleLapkin`

This is a continuation of me looking at foundational stuff that ends up with more instructions than it really needs.  Specifically I noticed this one because `Range::next` isn't MIR-inlining, and one of the largest parts of it is a `replace::<usize>` that's a good dozen instructions instead of the two it could be.

So this means that `ptr::write` with a `Copy` type no longer generates worse IR than manually dereferencing (well, at least in LLVM -- MIR still has bonus pointer casts), and in doing so means that we're finally down to just the two essential `memcpy`s when emitting `mem::replace` for a large type, rather than the bonus-`alloca` and three `memcpy`s we emitted before this ([or the 6 we currently emit in 1.69 stable](https://rust.godbolt.org/z/67W8on6nP)).  That said, LLVM does _usually_ manage to optimize the extra code away.  But it's still nice for it not to have to do as much, thanks to (for example) not going through an `alloca` when `replace`ing a primitive like a `usize`.

(This is a new intrinsic, but one that's immediately lowered to existing MIR constructs, so not anything that MIRI or the codegen backends or MIR semantics needs to do work to handle.)
2023-05-01 14:29:15 +00:00
..
assembly Add loongarch64 asm! support 2023-04-25 14:15:31 +08:00
auxiliary
codegen Codegen fewer instructions in mem::replace 2023-04-30 22:33:04 -07:00
codegen-units Turn off inlining for codegen-unit tests 2023-04-07 15:46:45 -04:00
debuginfo Remove repeated definite articles 2023-04-27 00:48:00 +08:00
incremental Turn on ConstDebugInfo pass. 2023-04-22 23:41:48 +02:00
mir-opt Auto merge of #111010 - scottmcm:mem-replace-simpler, r=WaffleLapkin 2023-05-01 14:29:15 +00:00
pretty Close parentheses for offset_of in AST pretty printing 2023-04-30 23:29:40 +02:00
run-make Auto merge of #110942 - Zalathar:coverage-tests, r=Mark-Simulacrum 2023-04-30 10:36:06 +00:00
run-make-fulldeps Bless run-make-fulldeps test. 2023-04-20 18:03:33 +00:00
run-pass-valgrind
rustdoc Rollup merge of #110631 - notriddle:notriddle/impl-trait-cycle, r=GuillaumeGomez 2023-04-30 16:25:46 +02:00
rustdoc-gui rustdoc: remove unneeded handleKey from settings.js 2023-04-21 16:42:23 -07:00
rustdoc-js rustdoc-search: add support for nested generics 2023-04-14 14:55:45 -07:00
rustdoc-js-std rustdoc-search: add support for nested generics 2023-04-14 14:55:45 -07:00
rustdoc-json Move test from rustdoc-ui to rustdoc-json 2023-04-14 18:19:49 +00:00
rustdoc-ui Rollup merge of #110631 - notriddle:notriddle/impl-trait-cycle, r=GuillaumeGomez 2023-04-30 16:25:46 +02:00
ui Rollup merge of #111023 - tmiasko:multi-variant-capture, r=compiler-errors 2023-05-01 01:09:48 +02:00
ui-fulldeps Add Call terminator to SMIR 2023-04-20 12:00:41 -03:00
COMPILER_TESTS.md