<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_codegen_ssa/src, branch try</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=try</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=try'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-07-21T16:54:24+00:00</updated>
<entry>
<title>Rollup merge of #142097 - ZuseZ4:offload-host1, r=oli-obk</title>
<updated>2025-07-21T16:54:24+00:00</updated>
<author>
<name>许杰友 Jieyou Xu (Joe)</name>
<email>39484203+jieyouxu@users.noreply.github.com</email>
</author>
<published>2025-07-21T16:54:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5e3eb2512591df0cef52404f0ea4202f58935a54'/>
<id>urn:sha1:5e3eb2512591df0cef52404f0ea4202f58935a54</id>
<content type='text'>
gpu offload host code generation

r? ghost

This will generate most of the host side code to use llvm's offload feature.
The first PR will only handle automatic mem-transfers to and from the device.
So if a user calls a kernel, we will copy inputs back and forth, but we won't do the actual kernel launch.
Before merging, we will use LLVM's Info infrastructure to verify that the memcopies match what openmp offloa generates in C++. `LIBOMPTARGET_INFO=-1 ./my_rust_binary` should print that a memcpy to and later from the device is happening.

A follow-up PR will generate the actual device-side kernel which will then do computations on the GPU.
A third PR will implement manual host2device and device2host functionality, but the goal is to minimize cases where a user has to overwrite our default handling due to performance issues.

I'm trying to get a full MVP out first, so this just recognizes GPU functions based on magic names. The final frontend will obviously move this over to use proper macros, like I'm already doing it for the autodiff work.
This work will also be compatible with std::autodiff, so one can differentiate GPU kernels.

Tracking:
- https://github.com/rust-lang/rust/issues/131513
</content>
</entry>
<entry>
<title>Ban projecting into SIMD types [MCP838]</title>
<updated>2025-07-20T17:22:09+00:00</updated>
<author>
<name>Scott McMurray</name>
<email>scottmcm@users.noreply.github.com</email>
</author>
<published>2025-03-07T03:13:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=41ce1ed252f194756fb2f3e3e92bbdfb3940088d'/>
<id>urn:sha1:41ce1ed252f194756fb2f3e3e92bbdfb3940088d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #144143 - Gelbpunkt:target-features-crt-static, r=RalfJung</title>
<updated>2025-07-20T13:34:07+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume1.gomez@gmail.com</email>
</author>
<published>2025-07-20T13:34:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1e6ef245cd56d0f787e61d7f5df077a3b82b0c86'/>
<id>urn:sha1:1e6ef245cd56d0f787e61d7f5df077a3b82b0c86</id>
<content type='text'>
Fix `-Ctarget-feature`s getting ignored after `crt-static`

The current behaviour introduced by commit a50a3b8e318594c41783294e440d864763e412ef would discard any target features specified after `crt-static` (the only member of `RUSTC_SPECIFIC_FEATURES`). This is because it returned instead of continuing processing the next feature.

I wasn't entirely sure how the regression test should look like, but this one should do. If anyone has some suggestions, I'm happy to learn, it's my first test :)

I've confirmed that the test fails without the fix on `powerpc64le-unknown-linux-musl` and `x86_64-unknown-linux-gnu`.

cc ``@RalfJung``
</content>
</entry>
<entry>
<title>Allow `Rvalue::Repeat` to return true in `rvalue_creates_operand` too</title>
<updated>2025-07-20T03:50:02+00:00</updated>
<author>
<name>Scott McMurray</name>
<email>scottmcm@users.noreply.github.com</email>
</author>
<published>2025-07-10T06:59:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0586c63e070981af7df53e2f778d3e50293d8103'/>
<id>urn:sha1:0586c63e070981af7df53e2f778d3e50293d8103</id>
<content type='text'>
The conversation in 143502 made be realize how easy this is to handle, since the only possibilty is ZSTs -- everything else ends up with the destination being `LocalKind::Memory` and thus doesn't call `codegen_rvalue_operand` at all.

This gets us perilously close to a world where `rvalue_creates_operand` only ever returns true.  I'll try out such a world next :)

</content>
</entry>
<entry>
<title>Auto merge of #143784 - scottmcm:enums-again-new-ex2, r=dianqk</title>
<updated>2025-07-19T08:03:40+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2025-07-19T08:03:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=83825dd277503edf5d7eda6be8b5fb9896f343f5'/>
<id>urn:sha1:83825dd277503edf5d7eda6be8b5fb9896f343f5</id>
<content type='text'>
Simplify discriminant codegen for niche-encoded variants which don't wrap across an integer boundary

Inspired by rust-lang/rust#139729, this attempts to be a much-simpler and more-localized change while still making a difference.  (Specifically, this does not try to solve the problem with select-sinking, leaving that to be fixed by https://github.com/llvm/llvm-project/issues/134024 -- once it gets released -- instead of in rustc's codegen.)

What this *does* improve is checking for the variant in a 3+ variant enum when that variant is the type providing the niche.  Something like `if let Foo::WithBool(_) = ...` previously compiled to `ugt(add(x, -2), 2)`, which is non-trivial to think about because it's depending on the unsigned wrapping to shift the 0/1 up above 2.  With this PR it compiles to just `ult(x, 2)`, which is probably what you'd have written yourself if you were doing it by hand to look for "is this byte a bool?".

That's done by leaving most of the codegen alone, but adding a couple new special cases to the `is_niche` check.  The default looks at the relative discriminant, but in the common cases where there's no wraparound involved, we can just check the original value, rather than the offsetted one.

The first commit just adds some tests, so the best way to see the effect of this change is to look at the second commit and how it updates the test expectations.
</content>
</entry>
<entry>
<title>add -Zoffload=Enable flag behind -Zunstable-options, to enable gpu (host) code generation</title>
<updated>2025-07-18T23:24:00+00:00</updated>
<author>
<name>Manuel Drehwald</name>
<email>git@manuel.drehwald.info</email>
</author>
<published>2025-06-18T22:29:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=634016478ec95c6ff933d32789e663ace78e8f82'/>
<id>urn:sha1:634016478ec95c6ff933d32789e663ace78e8f82</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rustc_codegen_ssa: Don't skip target-features after crt-static</title>
<updated>2025-07-18T16:59:13+00:00</updated>
<author>
<name>Jens Reidel</name>
<email>adrian@travitia.xyz</email>
</author>
<published>2025-07-18T16:29:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=664d742933e020f70032e0fd8cd9c8869848fd4f'/>
<id>urn:sha1:664d742933e020f70032e0fd8cd9c8869848fd4f</id>
<content type='text'>
The current behaviour introduced by commit
a50a3b8e318594c41783294e440d864763e412ef would discard any
target features specified after crt-static (the only member of
RUSTC_SPECIFIC_FEATURES). This is because it returned instead of
continuing processing the next flag.

Signed-off-by: Jens Reidel &lt;adrian@travitia.xyz&gt;
</content>
</entry>
<entry>
<title>Rollup merge of #143846 - usamoi:gc, r=bjorn3</title>
<updated>2025-07-18T02:27:52+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-07-18T02:27:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=79c8f9046029115864d2e446f5f8cd1c3459898f'/>
<id>urn:sha1:79c8f9046029115864d2e446f5f8cd1c3459898f</id>
<content type='text'>
pass --gc-sections if -Zexport-executable-symbols is enabled and improve tests

Exported symbols are added as GC roots in linking, so `--gc-sections` won't hurt `-Zexport-executable-symbols`.

Fixes the run-make test to work on Linux. Enable the ui test on more targets.

cc rust-lang/rust#84161
</content>
</entry>
<entry>
<title>Rollup merge of #143293 - folkertdev:naked-function-kcfi, r=compiler-errors</title>
<updated>2025-07-18T02:27:51+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-07-18T02:27:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=accf61dd42548bd5ec61d43f246b3eb499e980dd'/>
<id>urn:sha1:accf61dd42548bd5ec61d43f246b3eb499e980dd</id>
<content type='text'>
fix `-Zsanitizer=kcfi` on `#[naked]` functions

fixes https://github.com/rust-lang/rust/issues/143266

With `-Zsanitizer=kcfi`, indirect calls happen via generated intermediate shim that forwards the call. The generated shim preserves the attributes of the original, including `#[unsafe(naked)]`. The shim is not a naked function though, and violates its invariants (like having a body that consists of a single `naked_asm!` call).

My fix here is to match on the `InstanceKind`, and only use `codegen_naked_asm` when the instance is not a `ReifyShim`. That does beg the question whether there are other `InstanceKind`s that could come up. As far as I can tell the answer is no: calling via `dyn` seems to work find, and `#[track_caller]` is disallowed in combination with `#[naked]`.

r? codegen
````@rustbot```` label +A-naked
cc ````@maurer```` ````@rcvalle````
</content>
</entry>
<entry>
<title>remove no_gc_sections</title>
<updated>2025-07-17T06:54:52+00:00</updated>
<author>
<name>usamoi</name>
<email>usamoi@outlook.com</email>
</author>
<published>2025-07-14T08:41:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5bb6b9db300870f436e8a45ffbe11efa41e44cad'/>
<id>urn:sha1:5bb6b9db300870f436e8a45ffbe11efa41e44cad</id>
<content type='text'>
</content>
</entry>
</feed>
