Skip to content

Conversation

@alexander-dreyzen
Copy link

Title: Fix 'append-elements' codegen test robustness for LLVM 21 Description: The
append-elements.rs test was failing on newer LLVM versions due to fragile FileCheck patterns. This PR updates the patterns to handle newer variable naming conventions and attributes in memcpy calls while maintaining the same verification logic. Verified with ./x.py test and ./x.py test tidy.

The test was failing on LLVM 21 because of fragile FileCheck patterns
that didn't account for newer variable naming conventions and attributes
(like 'nonnull align 1') in memcpy calls.

The optimization itself is working correctly; this change just makes the
test verify the IR more reliably.
@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 Jan 27, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 27, 2026

r? @jieyouxu

rustbot has assigned @jieyouxu.
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

@nikic
Copy link
Contributor

nikic commented Jan 27, 2026

In what environment does this test currently fail, and how does the failure look like?

@alexander-dreyzen
Copy link
Author

@nikic
In my environment (x86_64-apple-darwin), the test was failing with a FileCheck mismatch:

---- [codegen] tests/codegen-llvm/lib-optimizations/append-elements.rs stdout ----
...
error: CHECK: expected string not found in input
...
The failure was a false positive caused by two factors in the generated IR for newer LLVM versions:

Greedy Regex Capture: The original CHECK-SAME pattern used {{.*}} between the pointer captures. In the generated signature for 
vec_append_with_temp_alloc
: define void @vec_append_with_temp_alloc(ptr nonnull align 1 %dst.0, ptr nonnull align 1 %src.0, i64 %src.1, ...) The greedy match was skipping %src.0 and capturing %src.1 (the length) as [[SRC]]. This caused the subsequent memcpy check to fail because it was looking for %src.1 as the source pointer. I've updated the pattern to use [^%]+ to ensure it captures the correct pointer variable.
Intervening Attributes: Newer LLVM versions generate memcpy calls with explicit attributes: call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %target, ptr nonnull align 1 %src.0, ...) The original pattern expected ptr %[[SRC]] directly after the comma, which failed to match the intervening nonnull align 1 attributes. I've added {{.*}} to the match to account for these.
The optimization itself (eliminating intermediate allocations via memcpy forwarding) is still working as intended; this change just makes the test patterns robust enough to verify it correctly.

@zachs18
Copy link
Contributor

zachs18 commented Jan 28, 2026

I also get an error on this test on x86_64-unknown-linux-gnu (Xubuntu 24.04.3), but looking more closely at the output, I think it's a different error(?) Oh, no the OP just doesn't contain the full error output, it's probably the same error.

`./x.py test tests/codegen-llvm` output

./x.py test tests/codegen-llvm

Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.03s
/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/build/x86_64-unknown-linux-gnu/ci-llvm/bin/llvm-strip does not exist; skipping copy
Building stage1 compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
    Finished `release` profile [optimized + debuginfo] target(s) in 0.12s
Creating a sysroot for stage1 compiler (use `rustup toolchain link 'name' build/host/stage1`)
Building stage1 lld-wrapper (stage0 -> stage1, x86_64-unknown-linux-gnu)
    Finished `release` profile [optimized + debuginfo] target(s) in 0.06s
Building stage1 library artifacts (stage1 -> stage1, x86_64-unknown-linux-gnu)
    Finished `dist` profile [optimized + debuginfo] target(s) in 0.01s
Building stage1 compiletest (stage0 -> stage1, x86_64-unknown-linux-gnu)
    Finished `release` profile [optimized + debuginfo] target(s) in 0.07s
Testing stage1 with compiletest suite=codegen-llvm mode=codegen (x86_64-unknown-linux-gnu)

running 1006 tests
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii   88/1006
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii  176/1006
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii  264/1006
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii  352/1006
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii  440/1006
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii  528/1006
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii  616/1006
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii  704/1006
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii  792/1006
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii  880/1006
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii  968/1006
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii....
[codegen] tests/codegen-llvm/lib-optimizations/append-elements.rs ... F


failures:

---- [codegen] tests/codegen-llvm/lib-optimizations/append-elements.rs stdout ----
------FileCheck stdout------------------------------

------FileCheck stderr------------------------------
/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/tests/codegen-llvm/lib-optimizations/append-elements.rs:16:12: error: CHECK: expected string not found in input
 // CHECK: call void @llvm.memcpy.{{.*}}[[DST]].i{{.*}}[[SRC]]
           ^
/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/build/x86_64-unknown-linux-gnu/test/codegen-llvm/lib-optimizations/append-elements/append-elements.ll:139:229: note: scanning from here
define void @vec_append_with_temp_alloc(ptr noalias noundef align 8 captures(none) dereferenceable(24) %dst, ptr noalias noundef nonnull readonly align 1 captures(none) %src.0, i64 noundef range(i64 0, -9223372036854775808) %src.1) unnamed_addr #1 personality ptr @rust_eh_personality {
                                                                                                                                                                                                                                    ^
/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/build/x86_64-unknown-linux-gnu/test/codegen-llvm/lib-optimizations/append-elements/append-elements.ll:139:229: note: with "DST" equal to "%dst"
define void @vec_append_with_temp_alloc(ptr noalias noundef align 8 captures(none) dereferenceable(24) %dst, ptr noalias noundef nonnull readonly align 1 captures(none) %src.0, i64 noundef range(i64 0, -9223372036854775808) %src.1) unnamed_addr #1 personality ptr @rust_eh_personality {
                                                                                                                                                                                                                                    ^
/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/build/x86_64-unknown-linux-gnu/test/codegen-llvm/lib-optimizations/append-elements/append-elements.ll:139:229: note: with "SRC" equal to "%src"
define void @vec_append_with_temp_alloc(ptr noalias noundef align 8 captures(none) dereferenceable(24) %dst, ptr noalias noundef nonnull readonly align 1 captures(none) %src.0, i64 noundef range(i64 0, -9223372036854775808) %src.1) unnamed_addr #1 personality ptr @rust_eh_personality {
                                                                                                                                                                                                                                    ^
/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/build/x86_64-unknown-linux-gnu/test/codegen-llvm/lib-optimizations/append-elements/append-elements.ll:174:7: note: possible intended match here
 tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %_35, ptr nonnull align 1 %src.0, i64 %src.1, i1 false)
      ^

Input file: /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/build/x86_64-unknown-linux-gnu/test/codegen-llvm/lib-optimizations/append-elements/append-elements.ll
Check file: /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/tests/codegen-llvm/lib-optimizations/append-elements.rs

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

Input was:
<<<<<<
            .
            .
            .
           39:  %self.val15.i = load ptr, ptr %0, align 8, !alias.scope !3 
           40: ; call <alloc::raw_vec::RawVecInner>::finish_grow 
           41:  call fastcc void @_RNvMs4_NtCskJ9maJmxjwV_5alloc7raw_vecNtB5_11RawVecInner11finish_growCslAzzQRh6qCt_15append_elements(ptr noalias noundef align 8 captures(none) dereferenceable(24) %self3.i, i64 %self5.i, ptr %self.val15.i, i64 noundef %_0.sroa.0.0.i16.i) 
           42:  %_37.i = load i64, ptr %self3.i, align 8, !range !9, !noalias !3, !noundef !8 
           43:  %1 = trunc nuw i64 %_37.i to i1 
           44:  %2 = getelementptr inbounds nuw i8, ptr %self3.i, i64 8 
           45:  br i1 %1, label %bb20.i, label %bb3 
           46:  
           47: bb20.i: ; preds = %bb11.i 
           48:  %e.0.i = load i64, ptr %2, align 8, !range !10, !noalias !3, !noundef !8 
           49:  %3 = getelementptr inbounds nuw i8, ptr %self3.i, i64 16 
           50:  %e.1.i = load i64, ptr %3, align 8, !noalias !3 
           51:  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %self3.i), !noalias !3 
           52:  br label %bb2 
           53:  
           54: bb2: ; preds = %bb20.i, %bb4.i 
           55:  %_0.sroa.5.0.i.ph = phi i64 [ undef, %bb4.i ], [ %e.1.i, %bb20.i ] 
           56:  %_0.sroa.0.0.i.ph = phi i64 [ 0, %bb4.i ], [ %e.0.i, %bb20.i ] 
           57: ; call alloc::raw_vec::handle_error 
           58:  tail call void @_RNvNtCskJ9maJmxjwV_5alloc7raw_vec12handle_error(i64 noundef %_0.sroa.0.0.i.ph, i64 %_0.sroa.5.0.i.ph) #13 
           59:  unreachable 
           60:  
           61: bb3: ; preds = %bb11.i 
           62:  %v.0.i = load ptr, ptr %2, align 8, !noalias !3, !nonnull !8, !noundef !8 
           63:  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %self3.i), !noalias !3 
           64:  store ptr %v.0.i, ptr %0, align 8, !alias.scope !3 
           65:  %4 = icmp sgt i64 %_0.sroa.0.0.i16.i, -1 
           66:  tail call void @llvm.assume(i1 %4) 
           67:  store i64 %_0.sroa.0.0.i16.i, ptr %slf, align 8, !alias.scope !3 
           68:  ret void 
           69: } 
           70:  
           71: ; <alloc::raw_vec::RawVecInner>::finish_grow 
           72: ; Function Attrs: cold nonlazybind uwtable 
           73: define internal fastcc void @_RNvMs4_NtCskJ9maJmxjwV_5alloc7raw_vecNtB5_11RawVecInner11finish_growCslAzzQRh6qCt_15append_elements(ptr dead_on_unwind noalias noundef nonnull writable writeonly align 8 captures(none) dereferenceable(24) %_0, i64 %self.0.val, ptr %self.8.val, i64 noundef %cap) unnamed_addr #0 { 
           74: start: 
           75:  %_27.i = icmp sgt i64 %cap, -1 
           76:  br i1 %_27.i, label %bb16, label %bb15, !prof !11 
           77:  
           78: bb15: ; preds = %start 
           79:  %0 = getelementptr inbounds nuw i8, ptr %_0, i64 8 
           80:  store i64 0, ptr %0, align 8 
           81:  br label %bb14 
           82:  
           83: bb16: ; preds = %start 
           84:  %1 = icmp eq i64 %self.0.val, 0 
           85:  br i1 %1, label %bb8, label %bb18 
           86:  
           87: bb8: ; preds = %bb16 
           88:  %2 = icmp eq i64 %cap, 0 
           89:  br i1 %2, label %bb12, label %bb4.i.i 
           90:  
           91: bb4.i.i: ; preds = %bb8 
           92: ; call __rustc::__rust_no_alloc_shim_is_unstable_v2 
           93:  tail call void @_RNvCs2fcwfXhWpkc_7___rustc35___rust_no_alloc_shim_is_unstable_v2() #14 
           94: ; call __rustc::__rust_alloc 
           95:  %3 = tail call noundef ptr @_RNvCs2fcwfXhWpkc_7___rustc12___rust_alloc(i64 noundef %cap, i64 noundef range(i64 1, -9223372036854775807) 1) #14 
           96:  br label %bb10 
           97:  
           98: bb18: ; preds = %bb16 
           99:  %4 = icmp ne ptr %self.8.val, null 
          100:  tail call void @llvm.assume(i1 %4) 
          101:  %_6.not.i.i = icmp ult i64 %cap, %self.0.val 
          102:  br i1 %_6.not.i.i, label %bb2.i.i11, label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator4grow.exit, !prof !6 
          103:  
          104: bb2.i.i11: ; preds = %bb18 
          105: ; call core::panicking::panic_fmt 
          106:  tail call void @_RNvNtCsiTQtmXicy1o_4core9panicking9panic_fmt(ptr noundef nonnull @alloc_7e80d81941cf5c819e3db4cff23967f9, ptr noundef nonnull inttoptr (i64 145 to ptr), ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24) @alloc_7a85beee600efdab45bd11cd7f93c791) #12 
          107:  unreachable 
          108:  
          109: _RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator4grow.exit: ; preds = %bb18 
          110: ; call __rustc::__rust_realloc 
          111:  %raw_ptr.i.i = tail call noundef ptr @_RNvCs2fcwfXhWpkc_7___rustc14___rust_realloc(ptr noundef nonnull %self.8.val, i64 noundef %self.0.val, i64 noundef range(i64 1, -9223372036854775807) 1, i64 noundef %cap) #14 
          112:  br label %bb10 
          113:  
          114: bb10: ; preds = %bb4.i.i, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator4grow.exit 
          115:  %raw_ptr.i.i.pn = phi ptr [ %raw_ptr.i.i, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator4grow.exit ], [ %3, %bb4.i.i ] 
          116:  %5 = icmp eq ptr %raw_ptr.i.i.pn, null 
          117:  br i1 %5, label %bb11, label %bb12 
          118:  
          119: bb11: ; preds = %bb10 
          120:  %6 = getelementptr inbounds nuw i8, ptr %_0, i64 8 
          121:  store i64 1, ptr %6, align 8 
          122:  br label %bb14 
          123:  
          124: bb12: ; preds = %bb8, %bb10 
          125:  %raw_ptr.i.i.pn12 = phi ptr [ %raw_ptr.i.i.pn, %bb10 ], [ inttoptr (i64 1 to ptr), %bb8 ] 
          126:  %7 = getelementptr inbounds nuw i8, ptr %_0, i64 8 
          127:  store ptr %raw_ptr.i.i.pn12, ptr %7, align 8 
          128:  br label %bb14 
          129:  
          130: bb14: ; preds = %bb12, %bb11, %bb15 
          131:  %storemerge6 = phi i64 [ 1, %bb15 ], [ 0, %bb12 ], [ 1, %bb11 ] 
          132:  %8 = getelementptr inbounds nuw i8, ptr %_0, i64 16 
          133:  store i64 %cap, ptr %8, align 8 
          134:  store i64 %storemerge6, ptr %_0, align 8 
          135:  ret void 
          136: } 
          137:  
          138: ; Function Attrs: nonlazybind uwtable 
          139: define void @vec_append_with_temp_alloc(ptr noalias noundef align 8 captures(none) dereferenceable(24) %dst, ptr noalias noundef nonnull readonly align 1 captures(none) %src.0, i64 noundef range(i64 0, -9223372036854775808) %src.1) unnamed_addr #1 personality ptr @rust_eh_personality { 
check:16'0                                                                                                                                                                                                                                         X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
check:16'1                                                                                                                                                                                                                                                                                                     with "DST" equal to "%dst"
check:16'2                                                                                                                                                                                                                                                                                                     with "SRC" equal to "%src"
          140: start: 
check:16'0     ~~~~~~~
          141:  %0 = icmp eq i64 %src.1, 0 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          142:  br i1 %0, label %bb13.thread, label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          143:  
check:16'0     ~
          144: _RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i: ; preds = %start 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          145: ; call __rustc::__rust_no_alloc_shim_is_unstable_v2 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          146:  tail call void @_RNvCs2fcwfXhWpkc_7___rustc35___rust_no_alloc_shim_is_unstable_v2() #14, !noalias !12 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          147:  %1 = getelementptr inbounds nuw i8, ptr %dst, i64 16 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          148:  %len.i = load i64, ptr %1, align 8, !alias.scope !15, !noundef !8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          149:  %self2.i = load i64, ptr %dst, align 8, !range !7, !alias.scope !15, !noundef !8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          150:  %_9.i = sub i64 %self2.i, %len.i 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          151:  %_7.i = icmp ugt i64 %src.1, %_9.i 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          152:  br i1 %_7.i, label %bb1.i, label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i5, !prof !18 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          153:  
check:16'0     ~
          154: bb1.i: ; preds = %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          155: ; call <alloc::raw_vec::RawVecInner<_>>::reserve::do_reserve_and_handle::<alloc::alloc::Global> 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          156:  tail call fastcc void @_RINvNvMs2_NtCskJ9maJmxjwV_5alloc7raw_vecINtB8_11RawVecInnerpE7reserve21do_reserve_and_handleNtNtBa_5alloc6GlobalECslAzzQRh6qCt_15append_elements(ptr noalias noundef nonnull align 8 dereferenceable(24) %dst, i64 noundef %len.i, i64 noundef %src.1) 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          157:  %_3228.pre = load i64, ptr %1, align 8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          158:  br label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i5 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          159:  
check:16'0     ~
          160: bb13.thread: ; preds = %start 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          161:  %2 = getelementptr inbounds nuw i8, ptr %dst, i64 16 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          162:  %_32 = load i64, ptr %2, align 8, !noundef !8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          163:  %_37 = icmp sgt i64 %_32, -1 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          164:  tail call void @llvm.assume(i1 %_37) 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          165:  br label %_RINvNtCsiTQtmXicy1o_4core3ptr13drop_in_placeINtNtCskJ9maJmxjwV_5alloc3vec3VechEECslAzzQRh6qCt_15append_elements.exit6 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          166:  
check:16'0     ~
          167: _RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i5: ; preds = %bb1.i, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          168:  %_3228 = phi i64 [ %_3228.pre, %bb1.i ], [ %len.i, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i ] 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          169:  %_3729 = icmp sgt i64 %_3228, -1 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          170:  tail call void @llvm.assume(i1 %_3729) 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          171:  %3 = getelementptr inbounds nuw i8, ptr %dst, i64 8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          172:  %_38 = load ptr, ptr %3, align 8, !nonnull !8, !noundef !8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          173:  %_35 = getelementptr inbounds nuw i8, ptr %_38, i64 %_3228 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          174:  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %_35, ptr nonnull align 1 %src.0, i64 %src.1, i1 false) 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:16'3           ?                                                                                                             possible intended match
          175:  %4 = add nuw i64 %_3228, %src.1 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          176:  store i64 %4, ptr %1, align 8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          177:  br label %_RINvNtCsiTQtmXicy1o_4core3ptr13drop_in_placeINtNtCskJ9maJmxjwV_5alloc3vec3VechEECslAzzQRh6qCt_15append_elements.exit6 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          178:  
check:16'0     ~
          179: _RINvNtCsiTQtmXicy1o_4core3ptr13drop_in_placeINtNtCskJ9maJmxjwV_5alloc3vec3VechEECslAzzQRh6qCt_15append_elements.exit6: ; preds = %bb13.thread, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i5 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          180:  ret void 
check:16'0     ~~~~~~~~~~
          181: } 
check:16'0     ~~
          182:  
check:16'0     ~
          183: ; Function Attrs: nonlazybind uwtable 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          184: define void @string_append_with_temp_alloc(ptr noalias noundef align 8 captures(none) dereferenceable(24) %dst, ptr noalias noundef nonnull readonly align 1 captures(none) %src.0, i64 noundef %src.1) unnamed_addr #1 personality ptr @rust_eh_personality { 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          185: start: 
          186:  %_27.i.i = icmp sgt i64 %src.1, -1 
          187:  br i1 %_27.i.i, label %bb4.i, label %bb8, !prof !11 
          188:  
          189: bb4.i: ; preds = %start 
          190:  %0 = icmp eq i64 %src.1, 0 
          191:  br i1 %0, label %bb10.thread, label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i 
          192:  
          193: bb10.thread: ; preds = %bb4.i 
          194:  %1 = getelementptr inbounds nuw i8, ptr %dst, i64 16 
          195:  %len.i.i.i.i21 = load i64, ptr %1, align 8, !alias.scope !19, !noalias !28, !noundef !8 
          196:  %_10.i.i.i35 = icmp sgt i64 %len.i.i.i.i21, -1 
          197:  tail call void @llvm.assume(i1 %_10.i.i.i35) 
          198:  br label %_RINvNtCsiTQtmXicy1o_4core3ptr13drop_in_placeNtNtCskJ9maJmxjwV_5alloc6string6StringECslAzzQRh6qCt_15append_elements.exit5 
          199:  
          200: _RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i: ; preds = %bb4.i 
          201: ; call __rustc::__rust_no_alloc_shim_is_unstable_v2 
          202:  tail call void @_RNvCs2fcwfXhWpkc_7___rustc35___rust_no_alloc_shim_is_unstable_v2() #14, !noalias !30 
          203:  %2 = getelementptr inbounds nuw i8, ptr %dst, i64 16 
          204:  %len.i.i.i.i = load i64, ptr %2, align 8, !alias.scope !33, !noalias !37, !noundef !8 
          205:  %self2.i.i.i.i = load i64, ptr %dst, align 8, !range !7, !alias.scope !33, !noalias !37, !noundef !8 
          206:  %_9.i.i.i.i = sub i64 %self2.i.i.i.i, %len.i.i.i.i 
          207:  %_7.i.i.i.i = icmp ugt i64 %src.1, %_9.i.i.i.i 
          208:  br i1 %_7.i.i.i.i, label %_RNvMs_NtCskJ9maJmxjwV_5alloc3vecINtB4_3VechE7reserveCslAzzQRh6qCt_15append_elements.exit.thread.i.i.i, label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i.i4, !prof !39 
          209:  
          210: bb8: ; preds = %start 
          211: ; call alloc::raw_vec::handle_error 
          212:  tail call void @_RNvNtCskJ9maJmxjwV_5alloc7raw_vec12handle_error(i64 noundef 0, i64 %src.1) #13 
          213:  unreachable 
          214:  
          215: _RNvMs_NtCskJ9maJmxjwV_5alloc3vecINtB4_3VechE7reserveCslAzzQRh6qCt_15append_elements.exit.thread.i.i.i: ; preds = %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i 
          216: ; call <alloc::raw_vec::RawVecInner<_>>::reserve::do_reserve_and_handle::<alloc::alloc::Global> 
          217:  tail call fastcc void @_RINvNvMs2_NtCskJ9maJmxjwV_5alloc7raw_vecINtB8_11RawVecInnerpE7reserve21do_reserve_and_handleNtNtBa_5alloc6GlobalECslAzzQRh6qCt_15append_elements(ptr noalias noundef nonnull align 8 dereferenceable(24) %dst, i64 noundef %len.i.i.i.i, i64 noundef range(i64 0, -9223372036854775808) %src.1) 
          218:  %len1.i.i.i = load i64, ptr %2, align 8, !alias.scope !40, !noalias !37, !noundef !8 
          219:  br label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i.i4 
          220:  
          221: _RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i.i4: ; preds = %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i, %_RNvMs_NtCskJ9maJmxjwV_5alloc3vecINtB4_3VechE7reserveCslAzzQRh6qCt_15append_elements.exit.thread.i.i.i 
          222:  %len.i.i.i.i.sink = phi i64 [ %len1.i.i.i, %_RNvMs_NtCskJ9maJmxjwV_5alloc3vecINtB4_3VechE7reserveCslAzzQRh6qCt_15append_elements.exit.thread.i.i.i ], [ %len.i.i.i.i, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i ] 
          223:  %_10.i.i.i = icmp sgt i64 %len.i.i.i.i.sink, -1 
          224:  tail call void @llvm.assume(i1 %_10.i.i.i) 
          225:  %3 = getelementptr inbounds nuw i8, ptr %dst, i64 8 
          226:  %_11.i.i.i = load ptr, ptr %3, align 8, !alias.scope !40, !noalias !37, !nonnull !8, !noundef !8 
          227:  %dst.i.i.i = getelementptr inbounds nuw i8, ptr %_11.i.i.i, i64 %len.i.i.i.i.sink 
          228:  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %dst.i.i.i, ptr nonnull align 1 %src.0, i64 %src.1, i1 false) 
          229:  %4 = add nuw i64 %len.i.i.i.i.sink, %src.1 
          230:  store i64 %4, ptr %2, align 8, !alias.scope !40, !noalias !37 
          231:  br label %_RINvNtCsiTQtmXicy1o_4core3ptr13drop_in_placeNtNtCskJ9maJmxjwV_5alloc6string6StringECslAzzQRh6qCt_15append_elements.exit5 
          232:  
          233: _RINvNtCsiTQtmXicy1o_4core3ptr13drop_in_placeNtNtCskJ9maJmxjwV_5alloc6string6StringECslAzzQRh6qCt_15append_elements.exit5: ; preds = %bb10.thread, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i.i4 
          234:  ret void 
          235: } 
          236:  
          237: ; Function Attrs: nounwind nonlazybind uwtable 
          238: declare noundef range(i32 0, 10) i32 @rust_eh_personality(i32 noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) unnamed_addr #2 
          239:  
          240: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
          241: declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #3 
          242:  
          243: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
          244: declare void @llvm.lifetime.end.p0(i64 immarg, ptr captures(none)) #3 
          245:  
          246: ; alloc::raw_vec::handle_error 
          247: ; Function Attrs: cold minsize noreturn nonlazybind optsize uwtable 
          248: declare void @_RNvNtCskJ9maJmxjwV_5alloc7raw_vec12handle_error(i64 noundef range(i64 0, -9223372036854775807), i64) unnamed_addr #4 
          249:  
          250: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) 
          251: declare void @llvm.assume(i1 noundef) #5 
          252:  
          253: ; core::panicking::panic_fmt 
          254: ; Function Attrs: cold noinline noreturn nonlazybind uwtable 
          255: declare void @_RNvNtCsiTQtmXicy1o_4core9panicking9panic_fmt(ptr noundef nonnull, ptr noundef nonnull, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24)) unnamed_addr #6 
          256:  
          257: ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) 
          258: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #7 
          259:  
          260: ; __rustc::__rust_realloc 
          261: ; Function Attrs: nounwind nonlazybind allockind("realloc,aligned") allocsize(3) uwtable 
          262: declare noalias noundef ptr @_RNvCs2fcwfXhWpkc_7___rustc14___rust_realloc(ptr allocptr noundef, i64 noundef, i64 allocalign noundef, i64 noundef) unnamed_addr #8 
          263:  
          264: ; __rustc::__rust_no_alloc_shim_is_unstable_v2 
          265: ; Function Attrs: nounwind nonlazybind uwtable 
          266: declare void @_RNvCs2fcwfXhWpkc_7___rustc35___rust_no_alloc_shim_is_unstable_v2() unnamed_addr #2 
          267:  
          268: ; __rustc::__rust_alloc 
          269: ; Function Attrs: nounwind nonlazybind allockind("alloc,uninitialized,aligned") allocsize(0) uwtable 
          270: declare noalias noundef ptr @_RNvCs2fcwfXhWpkc_7___rustc12___rust_alloc(i64 noundef, i64 allocalign noundef) unnamed_addr #9 
          271:  
          272: ; core::panicking::panic 
          273: ; Function Attrs: cold noinline noreturn nonlazybind uwtable 
          274: declare void @_RNvNtCsiTQtmXicy1o_4core9panicking5panic(ptr noalias noundef nonnull readonly align 1 captures(address, read_provenance), i64 noundef, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24)) unnamed_addr #6 
            .
            .
            .
>>>>>>

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

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/build/x86_64-unknown-linux-gnu/test/codegen-llvm/lib-optimizations/append-elements/append-elements.ll" "/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/tests/codegen-llvm/lib-optimizations/append-elements.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/tests/codegen-llvm/lib-optimizations/append-elements.rs:16:12: error: CHECK: expected string not found in input
 // CHECK: call void @llvm.memcpy.{{.*}}[[DST]].i{{.*}}[[SRC]]
           ^
/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/build/x86_64-unknown-linux-gnu/test/codegen-llvm/lib-optimizations/append-elements/append-elements.ll:139:229: note: scanning from here
define void @vec_append_with_temp_alloc(ptr noalias noundef align 8 captures(none) dereferenceable(24) %dst, ptr noalias noundef nonnull readonly align 1 captures(none) %src.0, i64 noundef range(i64 0, -9223372036854775808) %src.1) unnamed_addr #1 personality ptr @rust_eh_personality {
                                                                                                                                                                                                                                    ^
/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/build/x86_64-unknown-linux-gnu/test/codegen-llvm/lib-optimizations/append-elements/append-elements.ll:139:229: note: with "DST" equal to "%dst"
define void @vec_append_with_temp_alloc(ptr noalias noundef align 8 captures(none) dereferenceable(24) %dst, ptr noalias noundef nonnull readonly align 1 captures(none) %src.0, i64 noundef range(i64 0, -9223372036854775808) %src.1) unnamed_addr #1 personality ptr @rust_eh_personality {
                                                                                                                                                                                                                                    ^
/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/build/x86_64-unknown-linux-gnu/test/codegen-llvm/lib-optimizations/append-elements/append-elements.ll:139:229: note: with "SRC" equal to "%src"
define void @vec_append_with_temp_alloc(ptr noalias noundef align 8 captures(none) dereferenceable(24) %dst, ptr noalias noundef nonnull readonly align 1 captures(none) %src.0, i64 noundef range(i64 0, -9223372036854775808) %src.1) unnamed_addr #1 personality ptr @rust_eh_personality {
                                                                                                                                                                                                                                    ^
/home/zachary/opt_mount/zachary/Programming/rust-compiler-2/build/x86_64-unknown-linux-gnu/test/codegen-llvm/lib-optimizations/append-elements/append-elements.ll:174:7: note: possible intended match here
 tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %_35, ptr nonnull align 1 %src.0, i64 %src.1, i1 false)
      ^

Input file: /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/build/x86_64-unknown-linux-gnu/test/codegen-llvm/lib-optimizations/append-elements/append-elements.ll
Check file: /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/tests/codegen-llvm/lib-optimizations/append-elements.rs

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

Input was:
<<<<<<
            .
            .
            .
           39:  %self.val15.i = load ptr, ptr %0, align 8, !alias.scope !3 
           40: ; call <alloc::raw_vec::RawVecInner>::finish_grow 
           41:  call fastcc void @_RNvMs4_NtCskJ9maJmxjwV_5alloc7raw_vecNtB5_11RawVecInner11finish_growCslAzzQRh6qCt_15append_elements(ptr noalias noundef align 8 captures(none) dereferenceable(24) %self3.i, i64 %self5.i, ptr %self.val15.i, i64 noundef %_0.sroa.0.0.i16.i) 
           42:  %_37.i = load i64, ptr %self3.i, align 8, !range !9, !noalias !3, !noundef !8 
           43:  %1 = trunc nuw i64 %_37.i to i1 
           44:  %2 = getelementptr inbounds nuw i8, ptr %self3.i, i64 8 
           45:  br i1 %1, label %bb20.i, label %bb3 
           46:  
           47: bb20.i: ; preds = %bb11.i 
           48:  %e.0.i = load i64, ptr %2, align 8, !range !10, !noalias !3, !noundef !8 
           49:  %3 = getelementptr inbounds nuw i8, ptr %self3.i, i64 16 
           50:  %e.1.i = load i64, ptr %3, align 8, !noalias !3 
           51:  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %self3.i), !noalias !3 
           52:  br label %bb2 
           53:  
           54: bb2: ; preds = %bb20.i, %bb4.i 
           55:  %_0.sroa.5.0.i.ph = phi i64 [ undef, %bb4.i ], [ %e.1.i, %bb20.i ] 
           56:  %_0.sroa.0.0.i.ph = phi i64 [ 0, %bb4.i ], [ %e.0.i, %bb20.i ] 
           57: ; call alloc::raw_vec::handle_error 
           58:  tail call void @_RNvNtCskJ9maJmxjwV_5alloc7raw_vec12handle_error(i64 noundef %_0.sroa.0.0.i.ph, i64 %_0.sroa.5.0.i.ph) #13 
           59:  unreachable 
           60:  
           61: bb3: ; preds = %bb11.i 
           62:  %v.0.i = load ptr, ptr %2, align 8, !noalias !3, !nonnull !8, !noundef !8 
           63:  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %self3.i), !noalias !3 
           64:  store ptr %v.0.i, ptr %0, align 8, !alias.scope !3 
           65:  %4 = icmp sgt i64 %_0.sroa.0.0.i16.i, -1 
           66:  tail call void @llvm.assume(i1 %4) 
           67:  store i64 %_0.sroa.0.0.i16.i, ptr %slf, align 8, !alias.scope !3 
           68:  ret void 
           69: } 
           70:  
           71: ; <alloc::raw_vec::RawVecInner>::finish_grow 
           72: ; Function Attrs: cold nonlazybind uwtable 
           73: define internal fastcc void @_RNvMs4_NtCskJ9maJmxjwV_5alloc7raw_vecNtB5_11RawVecInner11finish_growCslAzzQRh6qCt_15append_elements(ptr dead_on_unwind noalias noundef nonnull writable writeonly align 8 captures(none) dereferenceable(24) %_0, i64 %self.0.val, ptr %self.8.val, i64 noundef %cap) unnamed_addr #0 { 
           74: start: 
           75:  %_27.i = icmp sgt i64 %cap, -1 
           76:  br i1 %_27.i, label %bb16, label %bb15, !prof !11 
           77:  
           78: bb15: ; preds = %start 
           79:  %0 = getelementptr inbounds nuw i8, ptr %_0, i64 8 
           80:  store i64 0, ptr %0, align 8 
           81:  br label %bb14 
           82:  
           83: bb16: ; preds = %start 
           84:  %1 = icmp eq i64 %self.0.val, 0 
           85:  br i1 %1, label %bb8, label %bb18 
           86:  
           87: bb8: ; preds = %bb16 
           88:  %2 = icmp eq i64 %cap, 0 
           89:  br i1 %2, label %bb12, label %bb4.i.i 
           90:  
           91: bb4.i.i: ; preds = %bb8 
           92: ; call __rustc::__rust_no_alloc_shim_is_unstable_v2 
           93:  tail call void @_RNvCs2fcwfXhWpkc_7___rustc35___rust_no_alloc_shim_is_unstable_v2() #14 
           94: ; call __rustc::__rust_alloc 
           95:  %3 = tail call noundef ptr @_RNvCs2fcwfXhWpkc_7___rustc12___rust_alloc(i64 noundef %cap, i64 noundef range(i64 1, -9223372036854775807) 1) #14 
           96:  br label %bb10 
           97:  
           98: bb18: ; preds = %bb16 
           99:  %4 = icmp ne ptr %self.8.val, null 
          100:  tail call void @llvm.assume(i1 %4) 
          101:  %_6.not.i.i = icmp ult i64 %cap, %self.0.val 
          102:  br i1 %_6.not.i.i, label %bb2.i.i11, label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator4grow.exit, !prof !6 
          103:  
          104: bb2.i.i11: ; preds = %bb18 
          105: ; call core::panicking::panic_fmt 
          106:  tail call void @_RNvNtCsiTQtmXicy1o_4core9panicking9panic_fmt(ptr noundef nonnull @alloc_7e80d81941cf5c819e3db4cff23967f9, ptr noundef nonnull inttoptr (i64 145 to ptr), ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24) @alloc_7a85beee600efdab45bd11cd7f93c791) #12 
          107:  unreachable 
          108:  
          109: _RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator4grow.exit: ; preds = %bb18 
          110: ; call __rustc::__rust_realloc 
          111:  %raw_ptr.i.i = tail call noundef ptr @_RNvCs2fcwfXhWpkc_7___rustc14___rust_realloc(ptr noundef nonnull %self.8.val, i64 noundef %self.0.val, i64 noundef range(i64 1, -9223372036854775807) 1, i64 noundef %cap) #14 
          112:  br label %bb10 
          113:  
          114: bb10: ; preds = %bb4.i.i, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator4grow.exit 
          115:  %raw_ptr.i.i.pn = phi ptr [ %raw_ptr.i.i, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator4grow.exit ], [ %3, %bb4.i.i ] 
          116:  %5 = icmp eq ptr %raw_ptr.i.i.pn, null 
          117:  br i1 %5, label %bb11, label %bb12 
          118:  
          119: bb11: ; preds = %bb10 
          120:  %6 = getelementptr inbounds nuw i8, ptr %_0, i64 8 
          121:  store i64 1, ptr %6, align 8 
          122:  br label %bb14 
          123:  
          124: bb12: ; preds = %bb8, %bb10 
          125:  %raw_ptr.i.i.pn12 = phi ptr [ %raw_ptr.i.i.pn, %bb10 ], [ inttoptr (i64 1 to ptr), %bb8 ] 
          126:  %7 = getelementptr inbounds nuw i8, ptr %_0, i64 8 
          127:  store ptr %raw_ptr.i.i.pn12, ptr %7, align 8 
          128:  br label %bb14 
          129:  
          130: bb14: ; preds = %bb12, %bb11, %bb15 
          131:  %storemerge6 = phi i64 [ 1, %bb15 ], [ 0, %bb12 ], [ 1, %bb11 ] 
          132:  %8 = getelementptr inbounds nuw i8, ptr %_0, i64 16 
          133:  store i64 %cap, ptr %8, align 8 
          134:  store i64 %storemerge6, ptr %_0, align 8 
          135:  ret void 
          136: } 
          137:  
          138: ; Function Attrs: nonlazybind uwtable 
          139: define void @vec_append_with_temp_alloc(ptr noalias noundef align 8 captures(none) dereferenceable(24) %dst, ptr noalias noundef nonnull readonly align 1 captures(none) %src.0, i64 noundef range(i64 0, -9223372036854775808) %src.1) unnamed_addr #1 personality ptr @rust_eh_personality { 
check:16'0                                                                                                                                                                                                                                         X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
check:16'1                                                                                                                                                                                                                                                                                                     with "DST" equal to "%dst"
check:16'2                                                                                                                                                                                                                                                                                                     with "SRC" equal to "%src"
          140: start: 
check:16'0     ~~~~~~~
          141:  %0 = icmp eq i64 %src.1, 0 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          142:  br i1 %0, label %bb13.thread, label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          143:  
check:16'0     ~
          144: _RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i: ; preds = %start 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          145: ; call __rustc::__rust_no_alloc_shim_is_unstable_v2 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          146:  tail call void @_RNvCs2fcwfXhWpkc_7___rustc35___rust_no_alloc_shim_is_unstable_v2() #14, !noalias !12 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          147:  %1 = getelementptr inbounds nuw i8, ptr %dst, i64 16 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          148:  %len.i = load i64, ptr %1, align 8, !alias.scope !15, !noundef !8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          149:  %self2.i = load i64, ptr %dst, align 8, !range !7, !alias.scope !15, !noundef !8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          150:  %_9.i = sub i64 %self2.i, %len.i 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          151:  %_7.i = icmp ugt i64 %src.1, %_9.i 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          152:  br i1 %_7.i, label %bb1.i, label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i5, !prof !18 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          153:  
check:16'0     ~
          154: bb1.i: ; preds = %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          155: ; call <alloc::raw_vec::RawVecInner<_>>::reserve::do_reserve_and_handle::<alloc::alloc::Global> 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          156:  tail call fastcc void @_RINvNvMs2_NtCskJ9maJmxjwV_5alloc7raw_vecINtB8_11RawVecInnerpE7reserve21do_reserve_and_handleNtNtBa_5alloc6GlobalECslAzzQRh6qCt_15append_elements(ptr noalias noundef nonnull align 8 dereferenceable(24) %dst, i64 noundef %len.i, i64 noundef %src.1) 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          157:  %_3228.pre = load i64, ptr %1, align 8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          158:  br label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i5 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          159:  
check:16'0     ~
          160: bb13.thread: ; preds = %start 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          161:  %2 = getelementptr inbounds nuw i8, ptr %dst, i64 16 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          162:  %_32 = load i64, ptr %2, align 8, !noundef !8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          163:  %_37 = icmp sgt i64 %_32, -1 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          164:  tail call void @llvm.assume(i1 %_37) 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          165:  br label %_RINvNtCsiTQtmXicy1o_4core3ptr13drop_in_placeINtNtCskJ9maJmxjwV_5alloc3vec3VechEECslAzzQRh6qCt_15append_elements.exit6 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          166:  
check:16'0     ~
          167: _RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i5: ; preds = %bb1.i, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          168:  %_3228 = phi i64 [ %_3228.pre, %bb1.i ], [ %len.i, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i ] 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          169:  %_3729 = icmp sgt i64 %_3228, -1 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          170:  tail call void @llvm.assume(i1 %_3729) 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          171:  %3 = getelementptr inbounds nuw i8, ptr %dst, i64 8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          172:  %_38 = load ptr, ptr %3, align 8, !nonnull !8, !noundef !8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          173:  %_35 = getelementptr inbounds nuw i8, ptr %_38, i64 %_3228 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          174:  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %_35, ptr nonnull align 1 %src.0, i64 %src.1, i1 false) 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:16'3           ?                                                                                                             possible intended match
          175:  %4 = add nuw i64 %_3228, %src.1 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          176:  store i64 %4, ptr %1, align 8 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          177:  br label %_RINvNtCsiTQtmXicy1o_4core3ptr13drop_in_placeINtNtCskJ9maJmxjwV_5alloc3vec3VechEECslAzzQRh6qCt_15append_elements.exit6 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          178:  
check:16'0     ~
          179: _RINvNtCsiTQtmXicy1o_4core3ptr13drop_in_placeINtNtCskJ9maJmxjwV_5alloc3vec3VechEECslAzzQRh6qCt_15append_elements.exit6: ; preds = %bb13.thread, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i5 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          180:  ret void 
check:16'0     ~~~~~~~~~~
          181: } 
check:16'0     ~~
          182:  
check:16'0     ~
          183: ; Function Attrs: nonlazybind uwtable 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          184: define void @string_append_with_temp_alloc(ptr noalias noundef align 8 captures(none) dereferenceable(24) %dst, ptr noalias noundef nonnull readonly align 1 captures(none) %src.0, i64 noundef %src.1) unnamed_addr #1 personality ptr @rust_eh_personality { 
check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          185: start: 
          186:  %_27.i.i = icmp sgt i64 %src.1, -1 
          187:  br i1 %_27.i.i, label %bb4.i, label %bb8, !prof !11 
          188:  
          189: bb4.i: ; preds = %start 
          190:  %0 = icmp eq i64 %src.1, 0 
          191:  br i1 %0, label %bb10.thread, label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i 
          192:  
          193: bb10.thread: ; preds = %bb4.i 
          194:  %1 = getelementptr inbounds nuw i8, ptr %dst, i64 16 
          195:  %len.i.i.i.i21 = load i64, ptr %1, align 8, !alias.scope !19, !noalias !28, !noundef !8 
          196:  %_10.i.i.i35 = icmp sgt i64 %len.i.i.i.i21, -1 
          197:  tail call void @llvm.assume(i1 %_10.i.i.i35) 
          198:  br label %_RINvNtCsiTQtmXicy1o_4core3ptr13drop_in_placeNtNtCskJ9maJmxjwV_5alloc6string6StringECslAzzQRh6qCt_15append_elements.exit5 
          199:  
          200: _RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i: ; preds = %bb4.i 
          201: ; call __rustc::__rust_no_alloc_shim_is_unstable_v2 
          202:  tail call void @_RNvCs2fcwfXhWpkc_7___rustc35___rust_no_alloc_shim_is_unstable_v2() #14, !noalias !30 
          203:  %2 = getelementptr inbounds nuw i8, ptr %dst, i64 16 
          204:  %len.i.i.i.i = load i64, ptr %2, align 8, !alias.scope !33, !noalias !37, !noundef !8 
          205:  %self2.i.i.i.i = load i64, ptr %dst, align 8, !range !7, !alias.scope !33, !noalias !37, !noundef !8 
          206:  %_9.i.i.i.i = sub i64 %self2.i.i.i.i, %len.i.i.i.i 
          207:  %_7.i.i.i.i = icmp ugt i64 %src.1, %_9.i.i.i.i 
          208:  br i1 %_7.i.i.i.i, label %_RNvMs_NtCskJ9maJmxjwV_5alloc3vecINtB4_3VechE7reserveCslAzzQRh6qCt_15append_elements.exit.thread.i.i.i, label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i.i4, !prof !39 
          209:  
          210: bb8: ; preds = %start 
          211: ; call alloc::raw_vec::handle_error 
          212:  tail call void @_RNvNtCskJ9maJmxjwV_5alloc7raw_vec12handle_error(i64 noundef 0, i64 %src.1) #13 
          213:  unreachable 
          214:  
          215: _RNvMs_NtCskJ9maJmxjwV_5alloc3vecINtB4_3VechE7reserveCslAzzQRh6qCt_15append_elements.exit.thread.i.i.i: ; preds = %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i 
          216: ; call <alloc::raw_vec::RawVecInner<_>>::reserve::do_reserve_and_handle::<alloc::alloc::Global> 
          217:  tail call fastcc void @_RINvNvMs2_NtCskJ9maJmxjwV_5alloc7raw_vecINtB8_11RawVecInnerpE7reserve21do_reserve_and_handleNtNtBa_5alloc6GlobalECslAzzQRh6qCt_15append_elements(ptr noalias noundef nonnull align 8 dereferenceable(24) %dst, i64 noundef %len.i.i.i.i, i64 noundef range(i64 0, -9223372036854775808) %src.1) 
          218:  %len1.i.i.i = load i64, ptr %2, align 8, !alias.scope !40, !noalias !37, !noundef !8 
          219:  br label %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i.i4 
          220:  
          221: _RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i.i4: ; preds = %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i, %_RNvMs_NtCskJ9maJmxjwV_5alloc3vecINtB4_3VechE7reserveCslAzzQRh6qCt_15append_elements.exit.thread.i.i.i 
          222:  %len.i.i.i.i.sink = phi i64 [ %len1.i.i.i, %_RNvMs_NtCskJ9maJmxjwV_5alloc3vecINtB4_3VechE7reserveCslAzzQRh6qCt_15append_elements.exit.thread.i.i.i ], [ %len.i.i.i.i, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator8allocate.exit.i ] 
          223:  %_10.i.i.i = icmp sgt i64 %len.i.i.i.i.sink, -1 
          224:  tail call void @llvm.assume(i1 %_10.i.i.i) 
          225:  %3 = getelementptr inbounds nuw i8, ptr %dst, i64 8 
          226:  %_11.i.i.i = load ptr, ptr %3, align 8, !alias.scope !40, !noalias !37, !nonnull !8, !noundef !8 
          227:  %dst.i.i.i = getelementptr inbounds nuw i8, ptr %_11.i.i.i, i64 %len.i.i.i.i.sink 
          228:  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %dst.i.i.i, ptr nonnull align 1 %src.0, i64 %src.1, i1 false) 
          229:  %4 = add nuw i64 %len.i.i.i.i.sink, %src.1 
          230:  store i64 %4, ptr %2, align 8, !alias.scope !40, !noalias !37 
          231:  br label %_RINvNtCsiTQtmXicy1o_4core3ptr13drop_in_placeNtNtCskJ9maJmxjwV_5alloc6string6StringECslAzzQRh6qCt_15append_elements.exit5 
          232:  
          233: _RINvNtCsiTQtmXicy1o_4core3ptr13drop_in_placeNtNtCskJ9maJmxjwV_5alloc6string6StringECslAzzQRh6qCt_15append_elements.exit5: ; preds = %bb10.thread, %_RNvXs_NtCskJ9maJmxjwV_5alloc5allocNtB4_6GlobalNtNtCsiTQtmXicy1o_4core5alloc9Allocator10deallocate.exit.i.i.i4.i.i4 
          234:  ret void 
          235: } 
          236:  
          237: ; Function Attrs: nounwind nonlazybind uwtable 
          238: declare noundef range(i32 0, 10) i32 @rust_eh_personality(i32 noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) unnamed_addr #2 
          239:  
          240: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
          241: declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #3 
          242:  
          243: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
          244: declare void @llvm.lifetime.end.p0(i64 immarg, ptr captures(none)) #3 
          245:  
          246: ; alloc::raw_vec::handle_error 
          247: ; Function Attrs: cold minsize noreturn nonlazybind optsize uwtable 
          248: declare void @_RNvNtCskJ9maJmxjwV_5alloc7raw_vec12handle_error(i64 noundef range(i64 0, -9223372036854775807), i64) unnamed_addr #4 
          249:  
          250: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) 
          251: declare void @llvm.assume(i1 noundef) #5 
          252:  
          253: ; core::panicking::panic_fmt 
          254: ; Function Attrs: cold noinline noreturn nonlazybind uwtable 
          255: declare void @_RNvNtCsiTQtmXicy1o_4core9panicking9panic_fmt(ptr noundef nonnull, ptr noundef nonnull, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24)) unnamed_addr #6 
          256:  
          257: ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) 
          258: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #7 
          259:  
          260: ; __rustc::__rust_realloc 
          261: ; Function Attrs: nounwind nonlazybind allockind("realloc,aligned") allocsize(3) uwtable 
          262: declare noalias noundef ptr @_RNvCs2fcwfXhWpkc_7___rustc14___rust_realloc(ptr allocptr noundef, i64 noundef, i64 allocalign noundef, i64 noundef) unnamed_addr #8 
          263:  
          264: ; __rustc::__rust_no_alloc_shim_is_unstable_v2 
          265: ; Function Attrs: nounwind nonlazybind uwtable 
          266: declare void @_RNvCs2fcwfXhWpkc_7___rustc35___rust_no_alloc_shim_is_unstable_v2() unnamed_addr #2 
          267:  
          268: ; __rustc::__rust_alloc 
          269: ; Function Attrs: nounwind nonlazybind allockind("alloc,uninitialized,aligned") allocsize(0) uwtable 
          270: declare noalias noundef ptr @_RNvCs2fcwfXhWpkc_7___rustc12___rust_alloc(i64 noundef, i64 allocalign noundef) unnamed_addr #9 
          271:  
          272: ; core::panicking::panic 
          273: ; Function Attrs: cold noinline noreturn nonlazybind uwtable 
          274: declare void @_RNvNtCsiTQtmXicy1o_4core9panicking5panic(ptr noalias noundef nonnull readonly align 1 captures(address, read_provenance), i64 noundef, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24)) unnamed_addr #6 
            .
            .
            .
>>>>>>
------------------------------------------

---- [codegen] tests/codegen-llvm/lib-optimizations/append-elements.rs stdout end ----

failures:
    [codegen] tests/codegen-llvm/lib-optimizations/append-elements.rs

test result: FAILED. 4 passed; 1 failed; 1001 ignored; 0 measured; 0 filtered out; finished in 70.13ms

Some tests failed in compiletest suite=codegen-llvm mode=codegen host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
help: ignored 892 up-to-date tests; use `--force-rerun` to prevent this

Build completed unsuccessfully in 0:00:00

The failing test was originally added in #130998, which was reverted in #151150 due to the test's flakiness, then was re-added in #151337 .

I have download-ci-llvm = false in my config.toml, and this appears to be important. However, on a fresh clone ./x.py test tests/codegen-llvm succeeds, with or without download-ci-llvm = false.

Okay, the important part seems to be profile = "compiler" in bootstrap.toml, that makes it reproduce on the fresh clone, (even without download-ci-llvm = false in config.toml), and profile = "library" makes it pass again.

@jieyouxu
Copy link
Member

cc @the8472 in case you have more context

@the8472
Copy link
Member

the8472 commented Jan 28, 2026

Originally I just matched the variable names but it was suggested that was too brittle so I tried to make it more general by using pattern matches but apparently not general enough... so the improvements are welcome.
I just wish we had a better tool than filecheck, it's difficult to do the right thing.

Anyway, the intent of the seems to preserved, so LGTM.

Comment on lines 12 to 16
// CHECK-SAME: (ptr {{[^%]+}}%[[DST:[a-z0-9._]+]], ptr {{[^%]+}}%[[SRC:[a-z0-9._]+]],
#[no_mangle]
pub fn vec_append_with_temp_alloc(dst: &mut Vec<u8>, src: &[u8]) {
// CHECK-NOT: call void @llvm.memcpy
// CHECK: call void @llvm.memcpy.{{.*}}[[DST]].i{{.*}}[[SRC]]
// CHECK: call void @llvm.memcpy.{{.*}}ptr {{.*}}%{{[0-9a-z._]+}}, ptr {{.*}}%[[SRC]]
Copy link
Member

@the8472 the8472 Jan 28, 2026

Choose a reason for hiding this comment

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

Wait, actually, doesn't this define DST on the top but then never matches on it?

@jieyouxu
Copy link
Member

r? @the8472 (since you're already reviewing it anyway)

@rustbot rustbot assigned the8472 and unassigned jieyouxu Jan 28, 2026
@alexander-dreyzen
Copy link
Author

@the8472

I've addressed addressed your feedback! I removed the unused [[DST]] capture group, verified the fix with ./x.py test, and pushed the update to your fork.

@the8472
Copy link
Member

the8472 commented Jan 28, 2026

Well, the capture was there to test that it memcpy's from one argument into the other, not something else that might be happening inbetween. If it now memcpy's into something then that might be some intermediate allocation again or an additional memcpy might be hidden in a called function or stuff like that.
So I am now less sure that it enforces the original intent.

@alexander-dreyzen
Copy link
Author

@the8472
Hmm, I think you are right. Updated PR to explicitly match the getelementptr and load sequence that derives the buffer pointer from the dst struct. This should preserve the original intent by proving that memcpy to the correct location while remaining compatible with newer LLVM IR.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@nikic
Copy link
Contributor

nikic commented Jan 28, 2026

@zachs18 Which LLVM are you using? Is it distro-provided?

A difference on x86_64-unknown-linux-gnu is odd, because that should be covered by CI, and this particular test is LLVM 21 only, so I wouldn't really expect variance.

@zachs18
Copy link
Contributor

zachs18 commented Jan 28, 2026

@zachs18 Which LLVM are you using? Is it distro-provided?

I am not (intentionally, at least) using a different LLVM than CI. This reprodices for me on a fresh clone of rust-lang/rust in a new directory, after adding profile = "compiler" to bootstrap.toml.

This happens on both my laptop and desktop.

// laptop
Model name:                           AMD Ryzen 7 5825U with Radeon Graphics    
Model:                                80
// desktop
Model name:                              AMD Ryzen 9 7900X 12-Core Processor
Model:                                   97

@rust-log-analyzer

This comment has been minimized.

#[no_mangle]
pub fn vec_append_with_temp_alloc(dst: &mut Vec<u8>, src: &[u8]) {
// CHECK-NOT: call void @llvm.memcpy
// CHECK: call void @llvm.memcpy.{{.*}}[[DST]].i{{.*}}[[SRC]]
Copy link
Member

Choose a reason for hiding this comment

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

To help anyone else who might, like me, have missed it: note that there's a .i on here; it wasn't actually looking for a memcpy to the &mut Vec.

Makes me think that perhaps the test wants the GEP+load in the checks too?

@alexander-dreyzen
Copy link
Author

alexander-dreyzen commented Jan 28, 2026

Originally I just matched the variable names but it was suggested that was too brittle so I tried to make it more general by using pattern matches but apparently not general enough... so the improvements are welcome. I just wish we had a better tool than filecheck, it's difficult to do the right thing.

Anyway, the intent of the seems to preserved, so LGTM.

After some thrashing I returned to a more general one liner that seems to work. Approve if the fix looks ok.

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants