Skip to content

Start using pattern types in libcore#136006

Open
oli-obk wants to merge 1 commit intorust-lang:mainfrom
oli-obk:push-tzonluoyuwkq
Open

Start using pattern types in libcore#136006
oli-obk wants to merge 1 commit intorust-lang:mainfrom
oli-obk:push-tzonluoyuwkq

Conversation

@oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jan 24, 2025

cc #135996

Replaces the innards of NonNull with *const T is !null.

This does affect LLVM's optimizations, as now reading the field preserves the metadata that the field is not null, and transmuting to another type (e.g. just a raw pointer), will also preserve that information for optimizations. This can cause LLVM opts to do more work, but it's not guaranteed to produce better machine code.

Once we also remove all uses of rustc_layout_scalar_range_start from rustc itself, we can remove the support for that attribute entirely and handle all such needs via pattern types

@rustbot

This comment was marked as outdated.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 24, 2025
@oli-obk oli-obk added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 24, 2025
@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well r=me when/if it does get unblocked.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@Veykril
Copy link
Member

Veykril commented Jan 27, 2025

Re rust-analyzer blocker, as it turns out to implement pattern types (to a degree that would unblock this) it comes down to the same architecture changes required as for rust-lang/rust-analyzer#7434 (which I am currently looking into), so that will take a bit.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 2025

Some changes occurred to the CTFE machinery

cc @rust-lang/wg-const-eval

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@rust-log-analyzer

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 12, 2026
Start using pattern types in libcore (NonZero and friends)

part of #136006 

This PR only changes the internal representation of `NonZero`, `NonMax`, ... and other integral range types in libcore. This subsequently affects other types made up of it, but nothing really changes except that the field of `NonZero` is now accessible safely in contrast to the `rustc_layout_scalar_range_start` attribute, which has all kinds of obscure rules on how to properly access its field.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Feb 13, 2026
Start using pattern types in libcore (NonZero and friends)

part of rust-lang/rust#136006 

This PR only changes the internal representation of `NonZero`, `NonMax`, ... and other integral range types in libcore. This subsequently affects other types made up of it, but nothing really changes except that the field of `NonZero` is now accessible safely in contrast to the `rustc_layout_scalar_range_start` attribute, which has all kinds of obscure rules on how to properly access its field.
@rustbot

This comment has been minimized.

@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 13, 2026

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 13, 2026
Start using pattern types in libcore
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 13, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 13, 2026

☀️ Try build successful (CI)
Build commit: 224f039 (224f0390307c2a60250e46665674e8530fa32631, parent: 47611e16044c68ef27bac31c35fda2ba1dc20b73)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (224f039): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
0.5% [0.0%, 1.8%] 8
Improvements ✅
(primary)
-0.8% [-3.2%, -0.2%] 20
Improvements ✅
(secondary)
-1.1% [-1.8%, -0.1%] 5
All ❌✅ (primary) -0.7% [-3.2%, 0.2%] 21

Max RSS (memory usage)

Results (primary 2.5%, secondary -2.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.9% [2.4%, 5.7%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.9% [-2.9%, -2.9%] 1
Improvements ✅
(secondary)
-2.6% [-3.4%, -1.7%] 2
All ❌✅ (primary) 2.5% [-2.9%, 5.7%] 5

Cycles

Results (primary -2.5%, secondary -0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.2% [2.4%, 8.3%] 4
Improvements ✅
(primary)
-2.5% [-2.5%, -2.5%] 1
Improvements ✅
(secondary)
-2.9% [-5.5%, -2.1%] 6
All ❌✅ (primary) -2.5% [-2.5%, -2.5%] 1

Binary size

Results (primary -0.1%, secondary 0.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.3% [0.0%, 0.9%] 9
Regressions ❌
(secondary)
1.0% [0.0%, 5.3%] 7
Improvements ✅
(primary)
-0.2% [-1.1%, -0.0%] 26
Improvements ✅
(secondary)
-0.1% [-0.9%, -0.0%] 22
All ❌✅ (primary) -0.1% [-1.1%, 0.9%] 35

Bootstrap: 482.691s -> 481.225s (-0.30%)
Artifact size: 398.13 MiB -> 396.21 MiB (-0.48%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 13, 2026
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 13, 2026

Hell yea

@rustbot ready

r? compiler

@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. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 13, 2026
// Remember to use `.as_ptr()` instead of `.pointer`, as field projecting to
// this is banned by <https://github.com/rust-lang/compiler-team/issues/807>.
pointer: *const T,
pointer: crate::pattern_type!(*const T is !null),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm excited to do this, but it feels odd to me to have both cg_ssa changes and the change to the library type in one PR.

Would it maybe be feasible to split this to have zero library changes, just enough new test coverage to justify the compiler updates, then a follow-up no-compiler-review-needed change to the library part?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I guess the box elaboration needs to be in the same PR as the library change, doesn't it :/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea... I can land some changes ahead of time, but I can only test them with a custom minicore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave this another try, I should be able to hit the cg_ssa changes with a test written on rustc today, but I'm missing some necessary component to actually go down this path. I tried https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=72f945c494a52dbb039b2aff32453d41 (and we already have a test that this is a permutation of: https://github.com/rust-lang/rust/blob/main/tests/ui/type/pattern_types/unsize.rs

_12 = NonNull::<T> { pointer: copy _14 };
_15 = copy _14 as (*const T) is !null (Transmute);
StorageDead(_14);
_12 = NonNull::<T> { pointer: move _15 };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not this PR's problem: looks like we should either avoid ever using NonNull(blah) in the library because that doesn't fold in GVN or should look at allowing constructors like this to fold with transmutes.

@rust-bors

This comment has been minimized.

github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Feb 16, 2026
Start using pattern types in libcore (NonZero and friends)

part of rust-lang/rust#136006 

This PR only changes the internal representation of `NonZero`, `NonMax`, ... and other integral range types in libcore. This subsequently affects other types made up of it, but nothing really changes except that the field of `NonZero` is now accessible safely in contrast to the `rustc_layout_scalar_range_start` attribute, which has all kinds of obscure rules on how to properly access its field.
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Feb 16, 2026
Start using pattern types in libcore (NonZero and friends)

part of rust-lang/rust#136006 

This PR only changes the internal representation of `NonZero`, `NonMax`, ... and other integral range types in libcore. This subsequently affects other types made up of it, but nothing really changes except that the field of `NonZero` is now accessible safely in contrast to the `rustc_layout_scalar_range_start` attribute, which has all kinds of obscure rules on how to properly access its field.
Use `!null` pattern type in libcore
@rustbot
Copy link
Collaborator

rustbot commented Feb 16, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
REPOSITORY                                   TAG       IMAGE ID       CREATED       SIZE
ghcr.io/dependabot/dependabot-updater-core   latest    afc745c7535d   2 weeks ago   783MB
=> Removing docker images...
Deleted Images:
untagged: ghcr.io/dependabot/dependabot-updater-core:latest
untagged: ghcr.io/dependabot/dependabot-updater-core@sha256:faae3d3a1dedd24cde388bb506bbacc0f7ed1eae99ebac129af66acd8540c84a
deleted: sha256:afc745c7535da1bb12f92c273b9a7e9c52c3f12c5873714b2542da259c6d9769
deleted: sha256:64e147d5e54d9be8b8aa322e511cda02296eda4b8b8d063c6a314833aca50e29
deleted: sha256:5cba409bb463f4e7fa1a19f695450170422582c1bc7c0e934d893b4e5f558bc6
deleted: sha256:cddc6ebd344b0111eaab170ead1dfda24acdfe865ed8a12599a34d338fa8e28b
deleted: sha256:2412c3f334d79134573cd45e657fb6cc0abd75bef3881458b0d498d936545c8d
---
test [ui] tests/ui/abi/abi-sysv64-register-usage.rs ... ignored, ignored when the architecture is aarch64
test [ui] tests/ui/abi/abi-typo-unstable.rs#feature_disabled ... ok
test [ui] tests/ui/abi/abi-typo-unstable.rs#feature_enabled ... ok
test [ui] tests/ui/abi/anon-extern-mod.rs ... ok
test [ui] tests/ui/abi/avr-sram.rs#disable_sram ... ok
test [ui] tests/ui/abi/avr-sram.rs#has_sram ... ok
test [ui] tests/ui/abi/arm-unadjusted-intrinsic.rs#aarch64 ... ok
test [ui] tests/ui/abi/avr-sram.rs#no_sram ... ok
test [ui] tests/ui/abi/arm-unadjusted-intrinsic.rs#arm ... ok
test [ui] tests/ui/abi/bad-custom.rs ... ok
test [ui] tests/ui/abi/c-stack-as-value.rs ... ok
test [ui] tests/ui/abi/c-zst.rs#aarch64-darwin ... ok
test [ui] tests/ui/abi/c-zst.rs#s390x-linux ... ok
---
test [ui] tests/ui/asm/aarch64/ttbr0_el2.rs ... ok
test [ui] tests/ui/asm/aarch64/type-check-3.rs ... ok
test [ui] tests/ui/asm/aarch64/type-check-2.rs ... ok
test [ui] tests/ui/asm/aarch64/type-f16.rs ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#hf ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#r82 ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#sf ... ok
test [ui] tests/ui/asm/aarch64/sym.rs ... ok
test [ui] tests/ui/asm/asm-with-nested-closure.rs ... ok
test [ui] tests/ui/asm/binary_asm_labels.rs ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/asm/arm-low-dreg.rs ... ok
test [ui] tests/ui/asm/cfg-parse-error.rs ... ok
---
test [ui] tests/ui/const-generics/occurs-check/unused-substs-4.rs ... ok
test [ui] tests/ui/const-generics/ogca/basic-fail.rs ... ok
test [ui] tests/ui/const-generics/ogca/basic.rs ... ok
test [ui] tests/ui/const-generics/occurs-check/unused-substs-5.rs ... ok
test [ui] tests/ui/const-generics/ogca/coherence-ambiguous.rs ... ok
test [ui] tests/ui/const-generics/ogca/rhs-but-not-root.rs ... ok
test [ui] tests/ui/const-generics/outer-lifetime-in-const-generic-default.rs ... ok
test [ui] tests/ui/const-generics/opaque_types.rs ... ok
test [ui] tests/ui/const-generics/opaque_types2.rs ... ok
test [ui] tests/ui/const-generics/overlapping_impls.rs ... ok
test [ui] tests/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs#full ... ok
---
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#fat3 ... ok
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#thin1 ... ok
test [ui] tests/ui/extern/issue-95829.rs ... ok
test [ui] tests/ui/extern/issue-80074.rs ... ok
test [ui] tests/ui/extern/lgamma-linkage.rs ... ok
test [ui] tests/ui/extern/not-in-block.rs ... ok
test [ui] tests/ui/extern/unsized-extern-derefmove.rs ... ok
test [ui] tests/ui/extern/no-mangle-associated-fn.rs ... ok
test [ui] tests/ui/feature-gates/allow-features-empty.rs ... ok
test [ui] tests/ui/extern/windows-tcb-trash-13259.rs ... ok
---
test [ui] tests/ui/feature-gates/feature-gate-macro-attr.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-loop-match.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-macro-metavar-expr-concat.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-marker_trait_attr.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-mgca-type-const-syntax.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-may-dangle.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-min-generic-const-args.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-movrs_target_feature.rs ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/feature-gates/feature-gate-more-qualified-paths.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-more-maybe-bounds.rs ... ok
---
test [ui] tests/ui/imports/ambiguous-7.rs ... ok
test [ui] tests/ui/imports/ambiguous-import-visibility-module.rs ... ok
test [ui] tests/ui/imports/ambiguous-8.rs ... ok
test [ui] tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-glob-vs-multiouter.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-globvsglob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-no-implicit-prelude.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-core-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-std-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-pick-core.rs ... ok
test [ui] tests/ui/imports/ambiguous-import-visibility-macro.rs ... ok
---
test [ui] tests/ui/layout/post-mono-layout-cycle.rs ... ok
test [ui] tests/ui/layout/randomize.rs#normal ... ok
test [ui] tests/ui/layout/randomize.rs#randomize-layout ... ok
test [ui] tests/ui/layout/null-pointer-optimization.rs ... ok
test [ui] tests/ui/layout/rigid-alias-due-to-broken-impl.rs ... ok
test [ui] tests/ui/layout/size-of-val-raw-too-big.rs ... ignored, only executed when the pointer width is 32bit (Layout computation rejects this layout for different reasons on 64-bit.)
test [ui] tests/ui/layout/reprc-power-alignment.rs ... ok
test [ui] tests/ui/layout/struct.rs ... ok
test [ui] tests/ui/layout/rust-call-abi-not-a-tuple-ice-81974.rs ... ok
test [ui] tests/ui/layout/rigid-alias-no-params.rs ... ok
---
------FileCheck stderr------------------------------
/checkout/tests/codegen-llvm/issues/for-loop-inner-assert-91109.rs:10:16: error: CHECK-NOT: excluded string found in input
 // CHECK-NOT: panic_bounds_check
               ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/issues/for-loop-inner-assert-91109/for-loop-inner-assert-91109.ll:61:25: note: found here
; call core::panicking::panic_bounds_check
                        ^~~~~~~~~~~~~~~~~~

Input file: /checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/issues/for-loop-inner-assert-91109/for-loop-inner-assert-91109.ll
Check file: /checkout/tests/codegen-llvm/issues/for-loop-inner-assert-91109.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
        1: ; ModuleID = 'for_loop_inner_assert_91109.44854a692dda60a9-cgu.0' 
        2: source_filename = "for_loop_inner_assert_91109.44854a692dda60a9-cgu.0" 
        3: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" 
        4: target triple = "aarch64-unknown-linux-gnu" 
        5:  
        6: %"alloc::vec::Vec<i32>" = type { %"alloc::raw_vec::RawVec<i32>", i64 } 
        7: %"alloc::raw_vec::RawVec<i32>" = type { %"core::marker::PhantomData<i32>", %"alloc::raw_vec::RawVecInner" } 
        8: %"core::marker::PhantomData<i32>" = type {} 
        9: %"alloc::raw_vec::RawVecInner" = type { ptr, i64, %"alloc::alloc::Global" } 
       10: %"alloc::alloc::Global" = type {} 
       11:  
       12: @alloc_8037057d752e95cb177947cdbddff6f8 = private unnamed_addr constant [67 x i8] c"/checkout/tests/codegen-llvm/issues/for-loop-inner-assert-91109.rs\00", align 1 
       13: @alloc_5d4e2812c9ea4048ad745e5e88543f81 = private unnamed_addr constant [33 x i8] c"assertion failed: d[i].len() == n", align 1 
       14: @alloc_efb41c7b440480510fa4e6566a6cf00e = private unnamed_addr constant <{ [4 x i8], [4 x i8], ptr, [12 x i8], [4 x i8] }> <{ [4 x i8] c"\0D\00\00\00", [4 x i8] undef, ptr @alloc_8037057d752e95cb177947cdbddff6f8, [12 x i8] c"B\00\00\00\00\00\00\00\09\00\00\00", [4 x i8] undef }>, align 8 
       15: @alloc_86236aae32091a6610ca0f26bf5fa9f7 = private unnamed_addr constant <{ [4 x i8], [4 x i8], ptr, [12 x i8], [4 x i8] }> <{ [4 x i8] c"\0F\00\00\00", [4 x i8] undef, ptr @alloc_8037057d752e95cb177947cdbddff6f8, [12 x i8] c"B\00\00\00\00\00\00\00\11\00\00\00", [4 x i8] undef }>, align 8 
       16:  
       17: ; Function Attrs: uwtable 
       18: define void @zero(ptr nocapture noundef nonnull readonly align 8 %d.0, i64 noundef range(i64 0, 384307168202282326) %d.1) unnamed_addr #0 { 
       19: start: 
       20:  %_147.not = icmp eq i64 %d.1, 0 
       21:  br i1 %_147.not, label %bb7, label %bb6 
       22:  
       23: bb1.loopexit: ; preds = %bb10 
       24:  %exitcond11.not = icmp eq i64 %0, %d.1 
       25:  br i1 %exitcond11.not, label %bb7, label %bb6 
       26:  
       27: bb7: ; preds = %bb1.loopexit, %start 
       28:  ret void 
       29:  
       30: bb6: ; preds = %start, %bb1.loopexit 
       31:  %iter.sroa.0.08 = phi i64 [ %0, %bb1.loopexit ], [ 0, %start ] 
       32:  %0 = add nuw nsw i64 %iter.sroa.0.08, 1 
       33:  %_7 = getelementptr inbounds nuw %"alloc::vec::Vec<i32>", ptr %d.0, i64 %iter.sroa.0.08 
       34:  %1 = getelementptr inbounds nuw i8, ptr %_7, i64 16 
       35:  %_6 = load i64, ptr %1, align 8, !noundef !2 
       36:  %_18 = icmp ult i64 %_6, 2305843009213693952 
       37:  tail call void @llvm.assume(i1 %_18) 
       38:  %_5 = icmp eq i64 %_6, %d.1 
       39:  br i1 %_5, label %bb8, label %bb4, !prof !3 
       40:  
       41: bb4: ; preds = %bb6 
       42: ; call core::panicking::panic 
       43:  tail call void @_RNvNtCsbEfPjgkO308_4core9panicking5panic(ptr noalias noundef nonnull readonly align 1 @alloc_5d4e2812c9ea4048ad745e5e88543f81, i64 noundef 33, ptr noalias noundef nonnull readonly align 8 dereferenceable(32) @alloc_efb41c7b440480510fa4e6566a6cf00e) #4 
       44:  unreachable 
       45:  
       46: bb8: ; preds = %bb6, %bb10 
       47:  %iter1.sroa.0.06 = phi i64 [ %2, %bb10 ], [ 0, %bb6 ] 
       48:  %_26 = load i64, ptr %1, align 8, !noundef !2 
       49:  %_28 = icmp ult i64 %iter1.sroa.0.06, %_26 
       50:  br i1 %_28, label %bb10, label %panic2 
       51:  
       52: bb10: ; preds = %bb8 
       53:  %_27 = load ptr, ptr %_7, align 8, !nonnull !2, !noundef !2 
       54:  %2 = add nuw nsw i64 %iter1.sroa.0.06, 1 
       55:  %_12 = getelementptr inbounds nuw i32, ptr %_27, i64 %iter1.sroa.0.06 
       56:  store i32 0, ptr %_12, align 4 
       57:  %exitcond.not = icmp eq i64 %2, %d.1 
       58:  br i1 %exitcond.not, label %bb1.loopexit, label %bb8 
       59:  
       60: panic2: ; preds = %bb8 
       61: ; call core::panicking::panic_bounds_check 
not:10                             !~~~~~~~~~~~~~~~~~  error: no match expected
       62:  tail call void @_RNvNtCsbEfPjgkO308_4core9panicking18panic_bounds_check(i64 noundef %iter1.sroa.0.06, i64 noundef %_26, ptr noalias noundef nonnull readonly align 8 dereferenceable(32) @alloc_86236aae32091a6610ca0f26bf5fa9f7) #4 
       63:  unreachable 
       64: } 
       65:  
       66: ; core::panicking::panic_bounds_check 
       67: ; Function Attrs: cold minsize noinline noreturn optsize uwtable 
       68: declare void @_RNvNtCsbEfPjgkO308_4core9panicking18panic_bounds_check(i64 noundef, i64 noundef, ptr noalias noundef readonly align 8 dereferenceable(32)) unnamed_addr #1 
       69:  
       70: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) 
       71: declare void @llvm.assume(i1 noundef) #2 
       72:  
       73: ; core::panicking::panic 
       74: ; Function Attrs: cold noinline noreturn uwtable 
       75: declare void @_RNvNtCsbEfPjgkO308_4core9panicking5panic(ptr noalias noundef nonnull readonly align 1, i64 noundef, ptr noalias noundef readonly align 8 dereferenceable(32)) unnamed_addr #3 
       76:  
       77: attributes #0 = { uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
       78: attributes #1 = { cold minsize noinline noreturn optsize uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
       79: attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } 
       80: attributes #3 = { cold noinline noreturn uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
       81: attributes #4 = { noinline noreturn } 
       82:  
       83: !llvm.module.flags = !{!0} 
       84: !llvm.ident = !{!1} 
       85:  
       86: !0 = !{i32 8, !"PIC Level", i32 2} 
       87: !1 = !{!"rustc version 1.95.0-nightly (3db1de40a 2026-02-16)"} 
       88: !2 = !{} 
       89: !3 = !{!"branch_weights", !"expected", i32 2000, i32 1} 
>>>>>>

------------------------------------------

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/usr/lib/llvm-20/bin/FileCheck" "--input-file" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/issues/for-loop-inner-assert-91109/for-loop-inner-assert-91109.ll" "/checkout/tests/codegen-llvm/issues/for-loop-inner-assert-91109.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/checkout/tests/codegen-llvm/issues/for-loop-inner-assert-91109.rs:10:16: error: CHECK-NOT: excluded string found in input
 // CHECK-NOT: panic_bounds_check
               ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/issues/for-loop-inner-assert-91109/for-loop-inner-assert-91109.ll:61:25: note: found here
; call core::panicking::panic_bounds_check
                        ^~~~~~~~~~~~~~~~~~

Input file: /checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/issues/for-loop-inner-assert-91109/for-loop-inner-assert-91109.ll
Check file: /checkout/tests/codegen-llvm/issues/for-loop-inner-assert-91109.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
        1: ; ModuleID = 'for_loop_inner_assert_91109.44854a692dda60a9-cgu.0' 
        2: source_filename = "for_loop_inner_assert_91109.44854a692dda60a9-cgu.0" 
        3: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" 
        4: target triple = "aarch64-unknown-linux-gnu" 
        5:  
        6: %"alloc::vec::Vec<i32>" = type { %"alloc::raw_vec::RawVec<i32>", i64 } 
        7: %"alloc::raw_vec::RawVec<i32>" = type { %"core::marker::PhantomData<i32>", %"alloc::raw_vec::RawVecInner" } 
        8: %"core::marker::PhantomData<i32>" = type {} 
        9: %"alloc::raw_vec::RawVecInner" = type { ptr, i64, %"alloc::alloc::Global" } 
       10: %"alloc::alloc::Global" = type {} 
       11:  
       12: @alloc_8037057d752e95cb177947cdbddff6f8 = private unnamed_addr constant [67 x i8] c"/checkout/tests/codegen-llvm/issues/for-loop-inner-assert-91109.rs\00", align 1 
       13: @alloc_5d4e2812c9ea4048ad745e5e88543f81 = private unnamed_addr constant [33 x i8] c"assertion failed: d[i].len() == n", align 1 
       14: @alloc_efb41c7b440480510fa4e6566a6cf00e = private unnamed_addr constant <{ [4 x i8], [4 x i8], ptr, [12 x i8], [4 x i8] }> <{ [4 x i8] c"\0D\00\00\00", [4 x i8] undef, ptr @alloc_8037057d752e95cb177947cdbddff6f8, [12 x i8] c"B\00\00\00\00\00\00\00\09\00\00\00", [4 x i8] undef }>, align 8 
       15: @alloc_86236aae32091a6610ca0f26bf5fa9f7 = private unnamed_addr constant <{ [4 x i8], [4 x i8], ptr, [12 x i8], [4 x i8] }> <{ [4 x i8] c"\0F\00\00\00", [4 x i8] undef, ptr @alloc_8037057d752e95cb177947cdbddff6f8, [12 x i8] c"B\00\00\00\00\00\00\00\11\00\00\00", [4 x i8] undef }>, align 8 
       16:  
       17: ; Function Attrs: uwtable 
       18: define void @zero(ptr nocapture noundef nonnull readonly align 8 %d.0, i64 noundef range(i64 0, 384307168202282326) %d.1) unnamed_addr #0 { 
       19: start: 
       20:  %_147.not = icmp eq i64 %d.1, 0 
       21:  br i1 %_147.not, label %bb7, label %bb6 
       22:  
       23: bb1.loopexit: ; preds = %bb10 
       24:  %exitcond11.not = icmp eq i64 %0, %d.1 
       25:  br i1 %exitcond11.not, label %bb7, label %bb6 
       26:  
       27: bb7: ; preds = %bb1.loopexit, %start 
       28:  ret void 
       29:  
       30: bb6: ; preds = %start, %bb1.loopexit 
       31:  %iter.sroa.0.08 = phi i64 [ %0, %bb1.loopexit ], [ 0, %start ] 
       32:  %0 = add nuw nsw i64 %iter.sroa.0.08, 1 
       33:  %_7 = getelementptr inbounds nuw %"alloc::vec::Vec<i32>", ptr %d.0, i64 %iter.sroa.0.08 
       34:  %1 = getelementptr inbounds nuw i8, ptr %_7, i64 16 
       35:  %_6 = load i64, ptr %1, align 8, !noundef !2 
       36:  %_18 = icmp ult i64 %_6, 2305843009213693952 
       37:  tail call void @llvm.assume(i1 %_18) 
       38:  %_5 = icmp eq i64 %_6, %d.1 
       39:  br i1 %_5, label %bb8, label %bb4, !prof !3 
       40:  
       41: bb4: ; preds = %bb6 
       42: ; call core::panicking::panic 
       43:  tail call void @_RNvNtCsbEfPjgkO308_4core9panicking5panic(ptr noalias noundef nonnull readonly align 1 @alloc_5d4e2812c9ea4048ad745e5e88543f81, i64 noundef 33, ptr noalias noundef nonnull readonly align 8 dereferenceable(32) @alloc_efb41c7b440480510fa4e6566a6cf00e) #4 
       44:  unreachable 
       45:  
       46: bb8: ; preds = %bb6, %bb10 
       47:  %iter1.sroa.0.06 = phi i64 [ %2, %bb10 ], [ 0, %bb6 ] 
       48:  %_26 = load i64, ptr %1, align 8, !noundef !2 
       49:  %_28 = icmp ult i64 %iter1.sroa.0.06, %_26 
       50:  br i1 %_28, label %bb10, label %panic2 
       51:  
       52: bb10: ; preds = %bb8 
       53:  %_27 = load ptr, ptr %_7, align 8, !nonnull !2, !noundef !2 
       54:  %2 = add nuw nsw i64 %iter1.sroa.0.06, 1 
       55:  %_12 = getelementptr inbounds nuw i32, ptr %_27, i64 %iter1.sroa.0.06 
       56:  store i32 0, ptr %_12, align 4 
       57:  %exitcond.not = icmp eq i64 %2, %d.1 
       58:  br i1 %exitcond.not, label %bb1.loopexit, label %bb8 
       59:  
       60: panic2: ; preds = %bb8 
       61: ; call core::panicking::panic_bounds_check 
not:10                             !~~~~~~~~~~~~~~~~~  error: no match expected
       62:  tail call void @_RNvNtCsbEfPjgkO308_4core9panicking18panic_bounds_check(i64 noundef %iter1.sroa.0.06, i64 noundef %_26, ptr noalias noundef nonnull readonly align 8 dereferenceable(32) @alloc_86236aae32091a6610ca0f26bf5fa9f7) #4 
       63:  unreachable 
       64: } 
       65:  
       66: ; core::panicking::panic_bounds_check 
       67: ; Function Attrs: cold minsize noinline noreturn optsize uwtable 
       68: declare void @_RNvNtCsbEfPjgkO308_4core9panicking18panic_bounds_check(i64 noundef, i64 noundef, ptr noalias noundef readonly align 8 dereferenceable(32)) unnamed_addr #1 
       69:  
       70: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) 
       71: declare void @llvm.assume(i1 noundef) #2 
       72:  
       73: ; core::panicking::panic 
       74: ; Function Attrs: cold noinline noreturn uwtable 
       75: declare void @_RNvNtCsbEfPjgkO308_4core9panicking5panic(ptr noalias noundef nonnull readonly align 1, i64 noundef, ptr noalias noundef readonly align 8 dereferenceable(32)) unnamed_addr #3 
       76:  
       77: attributes #0 = { uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
       78: attributes #1 = { cold minsize noinline noreturn optsize uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
       79: attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } 
       80: attributes #3 = { cold noinline noreturn uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
       81: attributes #4 = { noinline noreturn } 
       82:  
       83: !llvm.module.flags = !{!0} 
       84: !llvm.ident = !{!1} 
       85:  
       86: !0 = !{i32 8, !"PIC Level", i32 2} 
       87: !1 = !{!"rustc version 1.95.0-nightly (3db1de40a 2026-02-16)"} 
       88: !2 = !{} 
       89: !3 = !{!"branch_weights", !"expected", i32 2000, i32 1} 
>>>>>>
------------------------------------------

---- [codegen] tests/codegen-llvm/issues/for-loop-inner-assert-91109.rs stdout end ----
---- [codegen] tests/codegen-llvm/vec-reserve-extend.rs stdout ----
------FileCheck stdout------------------------------

------FileCheck stderr------------------------------
/checkout/tests/codegen-llvm/vec-reserve-extend.rs:10:16: error: CHECK-NOT: excluded string found in input
 // CHECK-NOT: call {{.*}}reserve
               ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/vec-reserve-extend/vec-reserve-extend.ll:334:3: note: found here
; call <alloc::raw_vec::RawVecInner<_>>::reserve::do_reserve_and_handle::<alloc::alloc::Global>
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/checkout/tests/codegen-llvm/vec-reserve-extend.rs:11:16: error: CHECK-NOT: excluded string found in input
 // CHECK-NOT: call {{.*}}do_reserve_and_handle
               ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/vec-reserve-extend/vec-reserve-extend.ll:334:3: note: found here
; call <alloc::raw_vec::RawVecInner<_>>::reserve::do_reserve_and_handle::<alloc::alloc::Global>
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Input file: /checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/vec-reserve-extend/vec-reserve-extend.ll
Check file: /checkout/tests/codegen-llvm/vec-reserve-extend.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
        .
        .
        .
      234: ; <usize as core::fmt::Debug>::fmt 
      235: ; Function Attrs: inlinehint uwtable 
      236: define internal noundef zeroext i1 @_RNvXsZ_NtNtCsbEfPjgkO308_4core3fmt3numjNtB7_5Debug3fmt(ptr noalias noundef readonly align 8 dereferenceable(8) %self, ptr noalias noundef align 8 dereferenceable(24) %f) unnamed_addr #2 { 
      237: start: 
      238:  %0 = getelementptr inbounds nuw i8, ptr %f, i64 20 
      239:  %_4 = load i32, ptr %0, align 4, !noundef !4 
      240:  %_3 = and i32 %_4, 33554432 
      241:  %1 = icmp eq i32 %_3, 0 
      242:  br i1 %1, label %bb2, label %bb1 
      243:  
      244: bb2: ; preds = %start 
      245:  %_5 = and i32 %_4, 67108864 
      246:  %2 = icmp eq i32 %_5, 0 
      247:  br i1 %2, label %bb4, label %bb3 
      248:  
      249: bb1: ; preds = %start 
      250: ; call <usize as core::fmt::LowerHex>::fmt 
      251:  %3 = tail call noundef zeroext i1 @_RNvXs6_NtNtCsbEfPjgkO308_4core3fmt3numjNtB7_8LowerHex3fmt(ptr noalias noundef nonnull readonly align 8 dereferenceable(8) %self, ptr noalias noundef nonnull align 8 dereferenceable(24) %f) 
      252:  br label %bb6 
      253:  
      254: bb4: ; preds = %bb2 
      255: ; call <usize as core::fmt::Display>::fmt 
      256:  %4 = tail call noundef zeroext i1 @_RNvXsi_NtNtNtCsbEfPjgkO308_4core3fmt3num3impjNtB9_7Display3fmt(ptr noalias noundef nonnull readonly align 8 dereferenceable(8) %self, ptr noalias noundef nonnull align 8 dereferenceable(24) %f) 
      257:  br label %bb6 
      258:  
      259: bb3: ; preds = %bb2 
      260: ; call <usize as core::fmt::UpperHex>::fmt 
      261:  %5 = tail call noundef zeroext i1 @_RNvXs8_NtNtCsbEfPjgkO308_4core3fmt3numjNtB7_8UpperHex3fmt(ptr noalias noundef nonnull readonly align 8 dereferenceable(8) %self, ptr noalias noundef nonnull align 8 dereferenceable(24) %f) 
      262:  br label %bb6 
      263:  
      264: bb6: ; preds = %bb4, %bb3, %bb1 
      265:  %_0.sroa.0.0.in = phi i1 [ %4, %bb4 ], [ %5, %bb3 ], [ %3, %bb1 ] 
      266:  ret i1 %_0.sroa.0.0.in 
      267: } 
      268:  
      269: ; Function Attrs: uwtable 
      270: define void @should_reserve_once(ptr nocapture noundef nonnull align 8 %v) unnamed_addr #1 personality ptr @rust_eh_personality { 
      271: start: 
      272:  %self3.i.i = alloca [24 x i8], align 8 
      273:  %e.i = alloca [16 x i8], align 8 
      274:  %0 = getelementptr inbounds nuw i8, ptr %v, i64 16 
      275:  %_6 = load i64, ptr %0, align 8, !noundef !4 
      276:  %1 = getelementptr inbounds nuw i8, ptr %v, i64 8 
      277:  %self4.i = load i64, ptr %1, align 8, !range !3, !noundef !4 
      278:  %_11.i = sub i64 %self4.i, %_6 
      279:  %_5.i = icmp ult i64 %_11.i, 3 
      280:  br i1 %_5.i, label %bb1.i, label %_RINvMsj_NtCseK1BIL12teM_5alloc3vecINtB6_3VechE14extend_trustedINtNtNtCsbEfPjgkO308_4core5array4iter8IntoIterhKj3_EECseHTl9kyFgP7_18vec_reserve_extend.exit 
      281:  
      282: bb1.i: ; preds = %start 
      283:  %_28.1.i.i = icmp ugt i64 %_6, -4 
      284:  br i1 %_28.1.i.i, label %bb2.i, label %bb12.i.i 
      285:  
      286: bb12.i.i: ; preds = %bb1.i 
      287:  %_28.0.i.i = add nuw i64 %_6, 3 
      288:  %2 = shl nuw i64 %self4.i, 1 
      289:  %_0.sroa.0.0.sroa.speculated.i.i.i = tail call noundef i64 @llvm.umax.i64(i64 %_28.0.i.i, i64 range(i64 0, -1) %2) 
      290:  %_0.sroa.0.0.sroa.speculated.i15.i.i = tail call noundef i64 @llvm.umax.i64(i64 %_0.sroa.0.0.sroa.speculated.i.i.i, i64 8) 
      291:  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %self3.i.i) 
      292:  %self.val.i.i = load ptr, ptr %v, align 8 
      293: ; call <alloc::raw_vec::RawVecInner>::finish_grow 
      294:  call fastcc void @_RNvMs4_NtCseK1BIL12teM_5alloc7raw_vecNtB5_11RawVecInner11finish_growCseHTl9kyFgP7_18vec_reserve_extend(ptr noalias noundef align 8 dereferenceable(24) %self3.i.i, ptr %self.val.i.i, i64 %self4.i, i64 noundef %_0.sroa.0.0.sroa.speculated.i15.i.i) 
      295:  %_40.i.i = load i64, ptr %self3.i.i, align 8, !range !5, !noundef !4 
      296:  %3 = trunc nuw i64 %_40.i.i to i1 
      297:  %4 = getelementptr inbounds nuw i8, ptr %self3.i.i, i64 8 
      298:  br i1 %3, label %bb21.i.i, label %_RNvMNtCsbEfPjgkO308_4core6resultINtB2_6ResultuNtNtCseK1BIL12teM_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit 
      299:  
      300: bb21.i.i: ; preds = %bb12.i.i 
      301:  %e.0.i.i = load i64, ptr %4, align 8 
      302:  %5 = getelementptr inbounds nuw i8, ptr %self3.i.i, i64 16 
      303:  %e.1.i.i = load i64, ptr %5, align 8, !range !6, !noundef !4 
      304:  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %self3.i.i) 
      305:  br label %bb2.i 
      306:  
      307: bb2.i: ; preds = %bb1.i, %bb21.i.i 
      308:  %_0.sroa.3.0.i.ph = phi i64 [ %e.1.i.i, %bb21.i.i ], [ 0, %bb1.i ] 
      309:  %_0.sroa.0.0.i.ph = phi i64 [ %e.0.i.i, %bb21.i.i ], [ undef, %bb1.i ] 
      310:  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %e.i) 
      311:  store i64 %_0.sroa.0.0.i.ph, ptr %e.i, align 8 
      312:  %6 = getelementptr inbounds nuw i8, ptr %e.i, i64 8 
      313:  store i64 %_0.sroa.3.0.i.ph, ptr %6, align 8 
      314: ; call core::result::unwrap_failed 
      315:  call void @_RNvNtCsbEfPjgkO308_4core6result13unwrap_failed(ptr noalias noundef nonnull readonly align 1 @alloc_00ae4b301f7fab8ac9617c03fcbd7274, i64 noundef 43, ptr noundef nonnull align 1 %e.i, ptr noalias noundef nonnull readonly align 8 dereferenceable(32) @vtable.0, ptr noalias noundef nonnull readonly align 8 dereferenceable(32) @alloc_cc3a80780a963fdd6152f98049ba4edc) #13 
      316:  unreachable 
      317:  
      318: _RNvMNtCsbEfPjgkO308_4core6resultINtB2_6ResultuNtNtCseK1BIL12teM_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit: ; preds = %bb12.i.i 
      319:  %v.0.i.i = load ptr, ptr %4, align 8, !nonnull !4, !noundef !4 
      320:  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %self3.i.i) 
      321:  store ptr %v.0.i.i, ptr %v, align 8 
      322:  %7 = icmp sgt i64 %_0.sroa.0.0.sroa.speculated.i15.i.i, -1 
      323:  tail call void @llvm.assume(i1 %7) 
      324:  store i64 %_0.sroa.0.0.sroa.speculated.i15.i.i, ptr %1, align 8 
      325:  %.pre.i = sub i64 %_0.sroa.0.0.sroa.speculated.i15.i.i, %_6 
      326:  %8 = icmp ugt i64 %.pre.i, 2 
      327:  %len.i.i.pre = load i64, ptr %0, align 8, !noalias !15 
      328:  %.pre = sub i64 %_0.sroa.0.0.sroa.speculated.i15.i.i, %len.i.i.pre 
      329:  %9 = icmp ult i64 %.pre, 3 
      330:  tail call void @llvm.assume(i1 %8) 
      331:  br i1 %9, label %bb1.i.i, label %_RINvMsj_NtCseK1BIL12teM_5alloc3vecINtB6_3VechE14extend_trustedINtNtNtCsbEfPjgkO308_4core5array4iter8IntoIterhKj3_EECseHTl9kyFgP7_18vec_reserve_extend.exit, !prof !18 
      332:  
      333: bb1.i.i: ; preds = %_RNvMNtCsbEfPjgkO308_4core6resultINtB2_6ResultuNtNtCseK1BIL12teM_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit 
      334: ; call <alloc::raw_vec::RawVecInner<_>>::reserve::do_reserve_and_handle::<alloc::alloc::Global> 
not:10       !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                     error: no match expected
not:11       !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                          error: no match expected
      335:  tail call fastcc void @_RINvNvMs2_NtCseK1BIL12teM_5alloc7raw_vecINtB8_11RawVecInnerpE7reserve21do_reserve_and_handleNtNtBa_5alloc6GlobalECseHTl9kyFgP7_18vec_reserve_extend(ptr noundef nonnull align 8 %v, i64 noundef %len.i.i.pre, i64 noundef 3) 
      336:  %_39.pre.i = load i64, ptr %0, align 8, !noalias !15 
      337:  br label %_RINvMsj_NtCseK1BIL12teM_5alloc3vecINtB6_3VechE14extend_trustedINtNtNtCsbEfPjgkO308_4core5array4iter8IntoIterhKj3_EECseHTl9kyFgP7_18vec_reserve_extend.exit 
      338:  
      339: _RINvMsj_NtCseK1BIL12teM_5alloc3vecINtB6_3VechE14extend_trustedINtNtNtCsbEfPjgkO308_4core5array4iter8IntoIterhKj3_EECseHTl9kyFgP7_18vec_reserve_extend.exit: ; preds = %start, %bb1.i.i, %_RNvMNtCsbEfPjgkO308_4core6resultINtB2_6ResultuNtNtCseK1BIL12teM_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit 
      340:  %_39.i = phi i64 [ %_39.pre.i, %bb1.i.i ], [ %len.i.i.pre, %_RNvMNtCsbEfPjgkO308_4core6resultINtB2_6ResultuNtNtCseK1BIL12teM_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit ], [ %_6, %start ] 
      341:  %_38.i = load ptr, ptr %v, align 8, !noalias !15, !nonnull !4, !noundef !4 
      342:  %scevgep.i.i = getelementptr i8, ptr %_38.i, i64 %_39.i 
      343:  store i8 1, ptr %scevgep.i.i, align 1, !noalias !19 
      344:  %_8.sroa.6.16.scevgep.i.i.sroa_idx = getelementptr inbounds nuw i8, ptr %scevgep.i.i, i64 1 
      345:  store i8 2, ptr %_8.sroa.6.16.scevgep.i.i.sroa_idx, align 1, !noalias !19 
      346:  %_8.sroa.7.16.scevgep.i.i.sroa_idx = getelementptr inbounds nuw i8, ptr %scevgep.i.i, i64 2 
      347:  store i8 3, ptr %_8.sroa.7.16.scevgep.i.i.sroa_idx, align 1, !noalias !19 
      348:  %10 = add i64 %_39.i, 3 
      349:  store i64 %10, ptr %0, align 8, !noalias !29 
      350:  ret void 
      351: } 
      352:  
      353: ; Function Attrs: nounwind uwtable 
      354: declare noundef range(i32 0, 10) i32 @rust_eh_personality(i32 noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) unnamed_addr #3 
      355:  
      356: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
      357: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 
      358:  
      359: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) 
      360: declare void @llvm.assume(i1 noundef) #5 
      361:  
      362: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
      363: declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 
      364:  
      365: ; core::panicking::panic_fmt 
      366: ; Function Attrs: cold noinline noreturn uwtable 
      367: declare void @_RNvNtCsbEfPjgkO308_4core9panicking9panic_fmt(ptr noundef nonnull, ptr noundef nonnull, ptr noalias noundef readonly align 8 dereferenceable(32)) unnamed_addr #6 
      368:  
      369: ; alloc::raw_vec::handle_error 
      370: ; Function Attrs: cold minsize noreturn optsize uwtable 
      371: declare void @_RNvNtCseK1BIL12teM_5alloc7raw_vec12handle_error(i64, i64 noundef range(i64 0, -9223372036854775807)) unnamed_addr #7 
      372:  
      373: ; core::panicking::panic 
      374: ; Function Attrs: cold noinline noreturn uwtable 
      375: declare void @_RNvNtCsbEfPjgkO308_4core9panicking5panic(ptr noalias noundef nonnull readonly align 1, i64 noundef, ptr noalias noundef readonly align 8 dereferenceable(32)) unnamed_addr #6 
      376:  
      377: ; core::result::unwrap_failed 
      378: ; Function Attrs: cold noinline noreturn uwtable 
      379: declare void @_RNvNtCsbEfPjgkO308_4core6result13unwrap_failed(ptr noalias noundef nonnull readonly align 1, i64 noundef, ptr noundef nonnull align 1, ptr noalias noundef readonly align 8 dereferenceable(32), ptr noalias noundef readonly align 8 dereferenceable(32)) unnamed_addr #6 
      380:  
      381: ; __rustc::__rust_realloc 
      382: ; Function Attrs: nounwind allockind("realloc,aligned") allocsize(3) uwtable 
      383: declare noalias noundef ptr @_RNvCsa0ooNdWUZvV_7___rustc14___rust_realloc(ptr allocptr noundef, i64 noundef, i64 allocalign noundef range(i64 1, -9223372036854775807), i64 noundef) unnamed_addr #8 
      384:  
      385: ; __rustc::__rust_no_alloc_shim_is_unstable_v2 
      386: ; Function Attrs: nounwind uwtable 
      387: declare void @_RNvCsa0ooNdWUZvV_7___rustc35___rust_no_alloc_shim_is_unstable_v2() unnamed_addr #3 
      388:  
      389: ; __rustc::__rust_alloc 
      390: ; Function Attrs: nounwind allockind("alloc,uninitialized,aligned") allocsize(0) uwtable 
      391: declare noalias noundef ptr @_RNvCsa0ooNdWUZvV_7___rustc12___rust_alloc(i64 noundef, i64 allocalign noundef range(i64 1, -9223372036854775807)) unnamed_addr #9 
      392:  
      393: ; <core::ptr::alignment::Alignment as core::fmt::Debug>::fmt 
      394: ; Function Attrs: uwtable 
      395: declare noundef zeroext i1 @_RNvXs_NtNtCsbEfPjgkO308_4core3ptr9alignmentNtB4_9AlignmentNtNtB8_3fmt5Debug3fmt(ptr noalias noundef readonly align 8 dereferenceable(8), ptr noalias noundef align 8 dereferenceable(24)) unnamed_addr #1 
      396:  
      397: ; <core::fmt::Formatter>::debug_struct_field2_finish 
      398: ; Function Attrs: uwtable 
      399: declare noundef zeroext i1 @_RNvMsa_NtCsbEfPjgkO308_4core3fmtNtB5_9Formatter26debug_struct_field2_finish(ptr noalias noundef align 8 dereferenceable(24), ptr noalias noundef nonnull readonly align 1, i64 noundef, ptr noalias noundef nonnull readonly align 1, i64 noundef, ptr noundef nonnull align 1, ptr noalias noundef readonly align 8 dereferenceable(32), ptr noalias noundef nonnull readonly align 1, i64 noundef, ptr noundef nonnull align 1, ptr noalias noundef readonly align 8 dereferenceable(32)) unnamed_addr #1 
      400:  
      401: ; <core::fmt::Formatter>::debug_struct_field1_finish 
      402: ; Function Attrs: uwtable 
      403: declare noundef zeroext i1 @_RNvMsa_NtCsbEfPjgkO308_4core3fmtNtB5_9Formatter26debug_struct_field1_finish(ptr noalias noundef align 8 dereferenceable(24), ptr noalias noundef nonnull readonly align 1, i64 noundef, ptr noalias noundef nonnull readonly align 1, i64 noundef, ptr noundef nonnull align 1, ptr noalias noundef readonly align 8 dereferenceable(32)) unnamed_addr #1 
      404:  
      405: ; <core::fmt::Formatter>::write_str 
      406: ; Function Attrs: uwtable 
      407: declare noundef zeroext i1 @_RNvMsa_NtCsbEfPjgkO308_4core3fmtNtB5_9Formatter9write_str(ptr noalias noundef align 8 dereferenceable(24), ptr noalias noundef nonnull readonly align 1, i64 noundef) unnamed_addr #1 
      408:  
      409: ; <usize as core::fmt::Display>::fmt 
      410: ; Function Attrs: uwtable 
      411: declare noundef zeroext i1 @_RNvXsi_NtNtNtCsbEfPjgkO308_4core3fmt3num3impjNtB9_7Display3fmt(ptr noalias noundef readonly align 8 dereferenceable(8), ptr noalias noundef align 8 dereferenceable(24)) unnamed_addr #1 
      412:  
      413: ; <usize as core::fmt::UpperHex>::fmt 
      414: ; Function Attrs: uwtable 
      415: declare noundef zeroext i1 @_RNvXs8_NtNtCsbEfPjgkO308_4core3fmt3numjNtB7_8UpperHex3fmt(ptr noalias noundef readonly align 8 dereferenceable(8), ptr noalias noundef align 8 dereferenceable(24)) unnamed_addr #1 
      416:  
      417: ; <usize as core::fmt::LowerHex>::fmt 
      418: ; Function Attrs: uwtable 
      419: declare noundef zeroext i1 @_RNvXs6_NtNtCsbEfPjgkO308_4core3fmt3numjNtB7_8LowerHex3fmt(ptr noalias noundef readonly align 8 dereferenceable(8), ptr noalias noundef align 8 dereferenceable(24)) unnamed_addr #1 
      420:  
      421: ; <core::fmt::Formatter>::pad 
      422: ; Function Attrs: uwtable 
      423: declare noundef zeroext i1 @_RNvMsa_NtCsbEfPjgkO308_4core3fmtNtB5_9Formatter3pad(ptr noalias noundef align 8 dereferenceable(24), ptr noalias noundef nonnull readonly align 1, i64 noundef) unnamed_addr #1 
      424:  
      425: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) 
      426: declare void @llvm.experimental.noalias.scope.decl(metadata) #10 
      427:  
      428: ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) 
      429: declare i64 @llvm.umax.i64(i64, i64) #11 
      430:  
      431: attributes #0 = { cold uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
      432: attributes #1 = { uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
      433: attributes #2 = { inlinehint uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
      434: attributes #3 = { nounwind uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
        .
        .
        .
>>>>>>

------------------------------------------

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/usr/lib/llvm-20/bin/FileCheck" "--input-file" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/vec-reserve-extend/vec-reserve-extend.ll" "/checkout/tests/codegen-llvm/vec-reserve-extend.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/checkout/tests/codegen-llvm/vec-reserve-extend.rs:10:16: error: CHECK-NOT: excluded string found in input
 // CHECK-NOT: call {{.*}}reserve
               ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/vec-reserve-extend/vec-reserve-extend.ll:334:3: note: found here
; call <alloc::raw_vec::RawVecInner<_>>::reserve::do_reserve_and_handle::<alloc::alloc::Global>
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/checkout/tests/codegen-llvm/vec-reserve-extend.rs:11:16: error: CHECK-NOT: excluded string found in input
 // CHECK-NOT: call {{.*}}do_reserve_and_handle
               ^
/checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/vec-reserve-extend/vec-reserve-extend.ll:334:3: note: found here
; call <alloc::raw_vec::RawVecInner<_>>::reserve::do_reserve_and_handle::<alloc::alloc::Global>
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Input file: /checkout/obj/build/aarch64-unknown-linux-gnu/test/codegen-llvm/vec-reserve-extend/vec-reserve-extend.ll
Check file: /checkout/tests/codegen-llvm/vec-reserve-extend.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
        .
        .
        .
      234: ; <usize as core::fmt::Debug>::fmt 
      235: ; Function Attrs: inlinehint uwtable 
      236: define internal noundef zeroext i1 @_RNvXsZ_NtNtCsbEfPjgkO308_4core3fmt3numjNtB7_5Debug3fmt(ptr noalias noundef readonly align 8 dereferenceable(8) %self, ptr noalias noundef align 8 dereferenceable(24) %f) unnamed_addr #2 { 
      237: start: 
      238:  %0 = getelementptr inbounds nuw i8, ptr %f, i64 20 
      239:  %_4 = load i32, ptr %0, align 4, !noundef !4 
      240:  %_3 = and i32 %_4, 33554432 
      241:  %1 = icmp eq i32 %_3, 0 
      242:  br i1 %1, label %bb2, label %bb1 
      243:  
      244: bb2: ; preds = %start 
      245:  %_5 = and i32 %_4, 67108864 
      246:  %2 = icmp eq i32 %_5, 0 

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 16, 2026

☔ The latest upstream changes (presumably #148190) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.