<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_codegen_llvm/src, branch beta</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=beta</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=beta'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-09-25T14:36:51+00:00</updated>
<entry>
<title>Revert "Auto merge of #144086 - clubby789:alloc-zeroed, r=nikic"</title>
<updated>2025-09-25T14:36:51+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2025-09-25T14:36:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=186d91daf73188357d569b41906aa5f44a55dfba'/>
<id>urn:sha1:186d91daf73188357d569b41906aa5f44a55dfba</id>
<content type='text'>
This reverts commit 040a98af70f0a7da03f3d5356531b28a2a7a77e4, reversing
changes made to e8a792daf500b5ff8097896ddb6cc037abe92487.
</content>
</entry>
<entry>
<title>Rollup merge of #144549 - folkertdev:va-arg-arm, r=saethlin</title>
<updated>2025-09-12T10:02:10+00:00</updated>
<author>
<name>Stuart Cook</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2025-09-12T10:02:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=48d684111e462b1ff600728b9a816520a4f3276a'/>
<id>urn:sha1:48d684111e462b1ff600728b9a816520a4f3276a</id>
<content type='text'>
match clang's `va_arg` assembly on arm targets

tracking issue: https://github.com/rust-lang/rust/issues/44930

For this example

```rust
#![feature(c_variadic)]

#[unsafe(no_mangle)]
unsafe extern "C" fn variadic(a: f64, mut args: ...) -&gt; f64 {
    let b = args.arg::&lt;f64&gt;();
    let c = args.arg::&lt;f64&gt;();

    a + b + c
}
```

We currently generate (via llvm):

```asm
variadic:
    sub     sp, sp, #12
    stmib   sp, {r2, r3}
    vmov    d0, r0, r1
    add     r0, sp, #4
    vldr    d1, [sp, #4]
    add     r0, r0, #15
    bic     r0, r0, #7
    vadd.f64        d0, d0, d1
    add     r1, r0, #8
    str     r1, [sp]
    vldr    d1, [r0]
    vadd.f64        d0, d0, d1
    vmov    r0, r1, d0
    add     sp, sp, #12
    bx      lr
```

LLVM is not doing a good job. In fact, it's well-known that LLVM's implementation of `va_arg` is kind of bad, and we implement it ourselves (based on clang) for many targets already. For arm,  our own `emit_ptr_va_arg` saves 3 instructions.

Next, it turns out it's important for LLVM to explicitly start and end the lifetime of the `va_list`. In https://github.com/rust-lang/rust/pull/146059 I already end the lifetime, but when looking at this again, I noticed that it is important to also start it, see https://godbolt.org/z/EGqvKTTsK: failing to explicitly start the lifetime uses an extra register.

So, the combination of `emit_ptr_va_arg` with starting/ending the lifetime makes rustc emit exactly the instructions that clang generates::

```asm
variadic:
    sub     sp, sp, #12
    stmib   sp, {r2, r3}
    vmov    d16, r0, r1
    vldr    d17, [sp, #4]
    vadd.f64        d16, d16, d17
    vldr    d17, [sp, #12]
    vadd.f64        d16, d16, d17
    vmov    r0, r1, d16
    add     sp, sp, #12
    bx      lr
```

The arguments to `emit_ptr_va_arg` are based on [the clang implementation](https://github.com/llvm/llvm-project/blob/03dc2a41f3d9a500e47b513de5c5008c06860d65/clang/lib/CodeGen/Targets/ARM.cpp#L798-L844).

r? ``@workingjubilee`` (I can re-roll if your queue is too full, but you do seem like the right person here)

try-job: armhf-gnu
</content>
</entry>
<entry>
<title>Rollup merge of #146178 - folkertdev:static-align, r=jdonszelmann,ralfjung,traviscross</title>
<updated>2025-09-10T12:17:38+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-09-10T12:17:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=422c76adae98b55d13a07a8fb47d8bc47fa96fdf'/>
<id>urn:sha1:422c76adae98b55d13a07a8fb47d8bc47fa96fdf</id>
<content type='text'>
Implement `#[rustc_align_static(N)]` on `static`s

Tracking issue: https://github.com/rust-lang/rust/issues/146177

```rust
#![feature(static_align)]

#[rustc_align_static(64)]
static SO_ALIGNED: u64 = 0;
```

We need a different attribute than `rustc_align` because unstable attributes are tied to their feature (we can't have two unstable features use the same unstable attribute). Otherwise this uses all of the same infrastructure as `#[rustc_align]`.

r? `@traviscross`
</content>
</entry>
<entry>
<title>allow `#[rustc_align_static(N)]` on `static`s</title>
<updated>2025-09-09T19:54:54+00:00</updated>
<author>
<name>Folkert de Vries</name>
<email>folkert@folkertdev.nl</email>
</author>
<published>2025-06-07T20:56:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cbacd00f106778830803ad2e2364518f06ff9078'/>
<id>urn:sha1:cbacd00f106778830803ad2e2364518f06ff9078</id>
<content type='text'>
We need a different attribute than `rustc_align` because unstable attributes are
tied to their feature (we can't have two unstable features use the same
unstable attribute). Otherwise this uses all of the same infrastructure
as `#[rustc_align]`.
</content>
</entry>
<entry>
<title>Auto merge of #145717 - BoxyUwU:erase_regions_rename, r=lcnr</title>
<updated>2025-09-09T15:04:44+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2025-09-09T15:04:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=364da5d88d772fa40fb20353443595385443ac25'/>
<id>urn:sha1:364da5d88d772fa40fb20353443595385443ac25</id>
<content type='text'>
rename erase_regions to erase_and_anonymize_regions

I find it consistently confusing that `erase_regions` does more than replacing regions with `'erased`. it also makes some code look real goofy to be writing manual folders to erase regions with a comment saying "we cant use erase regions" :&gt; or code that re-calls erase_regions on types with regions already erased just to anonymize all the bound regions.

r? lcnr

idk how i feel about the name being almost twice as long now
</content>
</entry>
<entry>
<title>erase_regions to erase_and_anonymize_regions</title>
<updated>2025-09-09T12:49:16+00:00</updated>
<author>
<name>Boxy</name>
<email>rust@boxyuwu.dev</email>
</author>
<published>2025-08-21T15:50:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e379c7758667f900aaf5551c4553c7d4c121e3e1'/>
<id>urn:sha1:e379c7758667f900aaf5551c4553c7d4c121e3e1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #146025 - Enselic:big-array-debuginfo-span, r=wesleywiser</title>
<updated>2025-09-09T04:35:02+00:00</updated>
<author>
<name>Stuart Cook</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2025-09-09T04:35:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a4774bfea3cff8a9780148de1ecf85c33f3c2473'/>
<id>urn:sha1:a4774bfea3cff8a9780148de1ecf85c33f3c2473</id>
<content type='text'>
compiler: Include span of too huge array with `-Cdebuginfo=2`

We have a few ui tests to ensure we emit an error if we encounter too big arrays. Before this fix, compiling the tests with `-Cdebuginfo=2` would not include the spans of the instantiation sites, because the error is then emitted from a different code path that does not include the span.

Propagate the span to the error also in the debuginfo case, so the tests passes regardless of debuginfo level.

r? ``@wesleywiser`` since this is a natural continuation of https://github.com/rust-lang/rust/pull/145967 that you approved (thanks!).

cc https://github.com/rust-lang/rust/issues/61117 since this takes is one step closer to increasing `rust.debuginfo-level-tests` to `2` in the **x86_64-gnu-debug** CI job.

## Test failure output without the fix

&lt;details&gt;
&lt;summary&gt;
Here is what the test failures look like if you run the tests without the fix. (Click to expand.)
&lt;/summary&gt;

```
$ ./x test --set rust.debuginfo-level-tests=2 tests/ui/limits/huge-array-simple-64.rs tests/ui/limits/huge-array.rs tests/ui/limits/issue-15919-64.rs
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.16s
/home/martin/src/rust/build/x86_64-unknown-linux-gnu/ci-llvm/bin/llvm-strip does not exist; skipping copy
Building stage1 compiler artifacts (stage0 -&gt; stage1, x86_64-unknown-linux-gnu)
    Finished `release` profile [optimized + debuginfo] target(s) in 0.40s
Creating a sysroot for stage1 compiler (use `rustup toolchain link 'name' build/host/stage1`)
Building stage1 lld-wrapper (stage0 -&gt; stage1, x86_64-unknown-linux-gnu)
    Finished `release` profile [optimized + debuginfo] target(s) in 0.08s
Building stage1 library artifacts (stage1 -&gt; stage1, x86_64-unknown-linux-gnu)
   Compiling addr2line v0.25.0
   Compiling std v0.0.0 (/home/martin/src/rust/library/std)
   Compiling rustc-std-workspace-std v1.99.0 (/home/martin/src/rust/library/rustc-std-workspace-std)
   Compiling unicode-width v0.2.1
   Compiling rustc-literal-escaper v0.0.5
   Compiling proc_macro v0.0.0 (/home/martin/src/rust/library/proc_macro)
   Compiling getopts v0.2.23
   Compiling test v0.0.0 (/home/martin/src/rust/library/test)
   Compiling sysroot v0.0.0 (/home/martin/src/rust/library/sysroot)
    Finished `release` profile [optimized + debuginfo] target(s) in 14.43s
Building stage1 compiletest (stage0 -&gt; stage1, x86_64-unknown-linux-gnu)
    Finished `release` profile [optimized + debuginfo] target(s) in 0.14s
Testing stage2 compiletest suite=ui mode=ui (stage1 -&gt; stage2, x86_64-unknown-linux-gnu)

running 6 tests

[ui] tests/ui/limits/huge-array.rs#full-debuginfo ... F

[ui] tests/ui/limits/issue-15919-64.rs#full-debuginfo ... F

[ui] tests/ui/limits/huge-array-simple-64.rs#full-debuginfo ... F
...

failures:

---- [ui] tests/ui/limits/huge-array.rs#full-debuginfo stdout ----
Saved the actual stderr to `/home/martin/src/rust/build/x86_64-unknown-linux-gnu/test/ui/limits/huge-array.full-debuginfo/huge-array.full-debuginfo.stderr`
diff of stderr:

1       error: values of the type `[[u8; 1518599999]; 1518600000]` are too big for the target architecture
-         --&gt; $DIR/huge-array.rs:9:9
-          |
-       LL |     let s: [T; 1518600000] = [t; 1518600000];
-          |         ^
6
7       error: aborting due to 1 previous error
8

The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args limits/huge-array.rs`

error in revision `full-debuginfo`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/martin/src/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/martin/src/rust/tests/ui/limits/huge-array.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/martin/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/martin/src/rust/vendor" "--sysroot" "/home/martin/src/rust/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--cfg" "full_debuginfo" "--check-cfg" "cfg(test,FALSE,no_debuginfo,full_debuginfo)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/home/martin/src/rust/build/x86_64-unknown-linux-gnu/test/ui/limits/huge-array.full-debuginfo" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Lnative=/home/martin/src/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Cdebuginfo=2"
stdout: none
--- stderr -------------------------------
error: values of the type `[[u8; 1518599999]; 1518600000]` are too big for the target architecture

error: aborting due to 1 previous error
------------------------------------------

---- [ui] tests/ui/limits/huge-array.rs#full-debuginfo stdout end ----
---- [ui] tests/ui/limits/issue-15919-64.rs#full-debuginfo stdout ----
Saved the actual stderr to `/home/martin/src/rust/build/x86_64-unknown-linux-gnu/test/ui/limits/issue-15919-64.full-debuginfo/issue-15919-64.full-debuginfo.stderr`
diff of stderr:

1       error: values of the type `[usize; usize::MAX]` are too big for the target architecture
-         --&gt; $DIR/issue-15919-64.rs:10:9
-          |
-       LL |     let x = [0usize; 0xffff_ffff_ffff_ffff];
-          |         ^
6
7       error: aborting due to 1 previous error
8

The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args limits/issue-15919-64.rs`

error in revision `full-debuginfo`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/martin/src/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/martin/src/rust/tests/ui/limits/issue-15919-64.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/martin/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/martin/src/rust/vendor" "--sysroot" "/home/martin/src/rust/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--cfg" "full_debuginfo" "--check-cfg" "cfg(test,FALSE,no_debuginfo,full_debuginfo)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/home/martin/src/rust/build/x86_64-unknown-linux-gnu/test/ui/limits/issue-15919-64.full-debuginfo" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Lnative=/home/martin/src/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Cdebuginfo=2"
stdout: none
--- stderr -------------------------------
error: values of the type `[usize; usize::MAX]` are too big for the target architecture

error: aborting due to 1 previous error
------------------------------------------

---- [ui] tests/ui/limits/issue-15919-64.rs#full-debuginfo stdout end ----
---- [ui] tests/ui/limits/huge-array-simple-64.rs#full-debuginfo stdout ----
Saved the actual stderr to `/home/martin/src/rust/build/x86_64-unknown-linux-gnu/test/ui/limits/huge-array-simple-64.full-debuginfo/huge-array-simple-64.full-debuginfo.stderr`
diff of stderr:

1       error: values of the type `[u8; 2305843011361177600]` are too big for the target architecture
-         --&gt; $DIR/huge-array-simple-64.rs:12:9
-          |
-       LL |     let _fat: [u8; (1&lt;&lt;61)+(1&lt;&lt;31)] =
-          |         ^^^^
6
7       error: aborting due to 1 previous error
8

The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args limits/huge-array-simple-64.rs`

error in revision `full-debuginfo`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/martin/src/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/martin/src/rust/tests/ui/limits/huge-array-simple-64.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/martin/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/martin/src/rust/vendor" "--sysroot" "/home/martin/src/rust/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--cfg" "full_debuginfo" "--check-cfg" "cfg(test,FALSE,no_debuginfo,full_debuginfo)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/home/martin/src/rust/build/x86_64-unknown-linux-gnu/test/ui/limits/huge-array-simple-64.full-debuginfo" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Lnative=/home/martin/src/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Cdebuginfo=2"
stdout: none
--- stderr -------------------------------
error: values of the type `[u8; 2305843011361177600]` are too big for the target architecture

error: aborting due to 1 previous error
------------------------------------------

---- [ui] tests/ui/limits/huge-array-simple-64.rs#full-debuginfo stdout end ----

failures:
    [ui] tests/ui/limits/huge-array.rs#full-debuginfo
    [ui] tests/ui/limits/issue-15919-64.rs#full-debuginfo
    [ui] tests/ui/limits/huge-array-simple-64.rs#full-debuginfo

test result: FAILED. 3 passed; 3 failed; 0 ignored; 0 measured; 19720 filtered out; finished in 117.18ms

Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
Build completed unsuccessfully in 0:00:17
```
&lt;/details&gt;

As can be seen, the span info is missing with debuginfo=2 without the fix.
</content>
</entry>
<entry>
<title>implement `va_arg` for arm in rustc itself</title>
<updated>2025-09-08T11:46:28+00:00</updated>
<author>
<name>Folkert de Vries</name>
<email>folkert@folkertdev.nl</email>
</author>
<published>2025-07-27T19:21:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=94fbb2178ae5960894aaae199233b0d3ac020d79'/>
<id>urn:sha1:94fbb2178ae5960894aaae199233b0d3ac020d79</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #146209 - bjorn3:lto_refactors5, r=dianqk</title>
<updated>2025-09-07T18:02:27+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-09-07T18:02:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=92bad93f06dc25a5370bbd85cf7e43160a03d80b'/>
<id>urn:sha1:92bad93f06dc25a5370bbd85cf7e43160a03d80b</id>
<content type='text'>
Misc LTO cleanups

Follow up to https://github.com/rust-lang/rust/pull/145955.

* Remove want_summary argument from `prepare_thin`.
   Since https://github.com/rust-lang/rust/pull/133250 ThinLTO summary writing is instead done by `llvm_optimize`.
* Two minor cleanups
</content>
</entry>
<entry>
<title>Rollup merge of #146236 - hkBst:gpu-1, r=ZuseZ4</title>
<updated>2025-09-06T21:49:53+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-09-06T21:49:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1123d49090e29ae2f4dd4131ababa9a41d45e637'/>
<id>urn:sha1:1123d49090e29ae2f4dd4131ababa9a41d45e637</id>
<content type='text'>
gpu offload: change suspicious map into filter

Fixes clippy warning:
```text
warning: this call to `map()` won't have an effect on the call to `count()`
   --&gt; compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs:194:25
    |
194 |       let num_ptr_types = types
    |  _________________________^
195 | |         .iter()
196 | |         .map(|&amp;x| matches!(cx.type_kind(x), rustc_codegen_ssa::common::TypeKind::Pointer))
197 | |         .count();
    | |________________^
    |
    = help: make sure you did not confuse `map` with `filter`, `for_each` or `inspect`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_map
    = note: `-W clippy::suspicious-map` implied by `-W clippy::suspicious`
    = help: to override `-W clippy::suspicious` add `#[allow(clippy::suspicious_map)]`
```
</content>
</entry>
</feed>
