Skip to content

tests: codegen-llvm: iter-repeat-n-trivial-drop: Allow non-zero lower bound to __rust_alloc size#153290

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Gelbpunkt:iter-repeat-n-trivial-drop-lower-bound-hermit
Mar 9, 2026
Merged

tests: codegen-llvm: iter-repeat-n-trivial-drop: Allow non-zero lower bound to __rust_alloc size#153290
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Gelbpunkt:iter-repeat-n-trivial-drop-lower-bound-hermit

Conversation

@Gelbpunkt
Copy link
Contributor

LLVM emits a lower bound of 8 for the size parameter to __rust_alloc when targeting x86_64-unknown-hermit. Since that is also completely valid, relax the lower bound check.

I'm not really sure why LLVM is able to infer this - with the same setup targeting x86_64-unknown-linux-gnu I also see the lower bound of 0. Not that it's wrong, but I'd be curious to know which codegen options play into this.

… bound to __rust_alloc size

LLVM emits a lower bound of 8 for the size parameter to __rust_alloc
when targeting x86_64-unknown-hermit. Since that is also completely
valid, relax the lower bound check.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 2, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Fallback group: @Mark-Simulacrum, @jieyouxu
  • @Mark-Simulacrum, @jieyouxu expanded to Mark-Simulacrum, jieyouxu
  • Random selection from Mark-Simulacrum, jieyouxu

@Mark-Simulacrum
Copy link
Member

@bors r+

Not sure why this is specific to hermit. It seems like the range attribute is a bit useless regardless, since the exact constant is known at the call site in this case...

  %0 = tail call noundef dereferenceable_or_null(1234) ptr @__rustc[4b3b3d5681ad023d]::__rust_alloc(i64 noundef range(i64 0, -9223372036854775808) 1234, i64 noundef 1) #7, !noalias !7

Seems like LLVM could then lower that to range(i64 1234, 1234) or so...

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 8, 2026

📌 Commit affe609 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 8, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Mar 9, 2026
…op-lower-bound-hermit, r=Mark-Simulacrum

tests: codegen-llvm: iter-repeat-n-trivial-drop: Allow non-zero lower bound to __rust_alloc size

LLVM emits a lower bound of 8 for the size parameter to `__rust_alloc` when targeting `x86_64-unknown-hermit`. Since that is also completely valid, relax the lower bound check.

I'm not really sure why LLVM is able to infer this - with the same setup targeting `x86_64-unknown-linux-gnu` I also see the lower bound of 0. Not that it's wrong, but I'd be curious to know which codegen options play into this.
rust-bors bot pushed a commit that referenced this pull request Mar 9, 2026
Rollup of 6 pull requests

Successful merges:

 - #153290 (tests: codegen-llvm: iter-repeat-n-trivial-drop: Allow non-zero lower bound to __rust_alloc size)
 - #153413 (std: organise `sys::pal::os`)
 - #139692 (Rustfmt now support use closures)
 - #153244 (tools: remote-test-server: Add UEFI run support)
 - #153305 (Adapt codegen test to accept operand bundles)
 - #153340 (tweak r-a default settings)
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 9, 2026

⌛ Testing commit affe609 with merge b772807...

Workflow: https://github.com/rust-lang/rust/actions/runs/22844155153

rust-bors bot pushed a commit that referenced this pull request Mar 9, 2026
…und-hermit, r=Mark-Simulacrum

tests: codegen-llvm: iter-repeat-n-trivial-drop: Allow non-zero lower bound to __rust_alloc size

LLVM emits a lower bound of 8 for the size parameter to `__rust_alloc` when targeting `x86_64-unknown-hermit`. Since that is also completely valid, relax the lower bound check.

I'm not really sure why LLVM is able to infer this - with the same setup targeting `x86_64-unknown-linux-gnu` I also see the lower bound of 0. Not that it's wrong, but I'd be curious to know which codegen options play into this.
@JonathanBrouwer
Copy link
Contributor

@bors yield
Yielding to enclosing rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 9, 2026

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #153590.

rust-bors bot pushed a commit that referenced this pull request Mar 9, 2026
Rollup of 6 pull requests

Successful merges:

 - #153290 (tests: codegen-llvm: iter-repeat-n-trivial-drop: Allow non-zero lower bound to __rust_alloc size)
 - #153413 (std: organise `sys::pal::os`)
 - #139692 (Rustfmt now support use closures)
 - #153244 (tools: remote-test-server: Add UEFI run support)
 - #153305 (Adapt codegen test to accept operand bundles)
 - #153340 (tweak r-a default settings)
rust-bors bot pushed a commit that referenced this pull request Mar 9, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #152847 (Test for armv7 `get_unchecked(...)` inlining)
 - #153290 (tests: codegen-llvm: iter-repeat-n-trivial-drop: Allow non-zero lower bound to __rust_alloc size)
 - #153413 (std: organise `sys::pal::os`)
 - #139692 (Rustfmt now support use closures)
 - #152800 (Adds recursion limit into FindParamInClause)
 - #153244 (tools: remote-test-server: Add UEFI run support)
 - #153305 (Adapt codegen test to accept operand bundles)
 - #153340 (tweak r-a default settings)
 - #153509 (Cleanup unused diagnostic emission methods - part 2)
 - #153527 (Fix LegacyKeyValueFormat report from docker build: ohos)
 - #153594 (Move some ui tests)
@rust-bors rust-bors bot merged commit 2f5d672 into rust-lang:main Mar 9, 2026
11 of 12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 9, 2026
rust-timer added a commit that referenced this pull request Mar 9, 2026
Rollup merge of #153290 - Gelbpunkt:iter-repeat-n-trivial-drop-lower-bound-hermit, r=Mark-Simulacrum

tests: codegen-llvm: iter-repeat-n-trivial-drop: Allow non-zero lower bound to __rust_alloc size

LLVM emits a lower bound of 8 for the size parameter to `__rust_alloc` when targeting `x86_64-unknown-hermit`. Since that is also completely valid, relax the lower bound check.

I'm not really sure why LLVM is able to infer this - with the same setup targeting `x86_64-unknown-linux-gnu` I also see the lower bound of 0. Not that it's wrong, but I'd be curious to know which codegen options play into this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants