Skip to content

Emit cold inline asm marker for cold_path intrinsic in LLVM backend#155272

Closed
Redslayer112 wants to merge 1 commit intorust-lang:mainfrom
Redslayer112:fix-cold-path-propagation
Closed

Emit cold inline asm marker for cold_path intrinsic in LLVM backend#155272
Redslayer112 wants to merge 1 commit intorust-lang:mainfrom
Redslayer112:fix-cold-path-propagation

Conversation

@Redslayer112
Copy link
Copy Markdown

@Redslayer112 Redslayer112 commented Apr 14, 2026

The cold_path intrinsic was a no-op in the SSA layer, which meant LLVM never saw any cold hint in blocks reached through generic FnOnce::call_once boundaries. The !prof metadata emitted by find_cold_blocks was dropped by LLVM's InlinerPass when folding redundant PHI+branch patterns.

This patch removes the SSA-level no-op for cold_path and adds an LLVM-specific handler that emits "asm sideeffect" with a "cold" call-site attribute. The sideeffect flag prevents any LLVM pass from removing the marker, while the cold attribute lets BranchProbabilityInfo mark the containing block as unlikely. The empty asm string produces zero machine instructions.

Fixes #155263

Testing

  • Added tests/codegen-llvm/hint/cold_path_propagation.rs regression test
  • Existing cold_path.rs test continues to pass
  • Cranelift backend unaffected (has its own set_cold_block handler)

The cold_path intrinsic was a no-op in the SSA layer, which meant LLVM
never saw any cold hint in blocks reached through generic FnOnce::call_once
boundaries. The !prof metadata emitted by find_cold_blocks was dropped by
LLVM's InlinerPass when folding redundant PHI+branch patterns.

This patch removes the SSA-level no-op for cold_path and adds an
LLVM-specific handler that emits "asm sideeffect" with a "cold" call-site
attribute. The sideeffect flag prevents any LLVM pass from removing the
marker, while the cold attribute lets BranchProbabilityInfo mark the
containing block as unlikely. The empty asm string produces zero machine
instructions.

Fixes rust-lang#155263
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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 Apr 14, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 14, 2026

r? @nnethercote

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

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 13 candidates

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 14, 2026

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
Executing "/scripts/stage_2_test_set1.sh"
+ /scripts/stage_2_test_set1.sh
+ '[' 1 == 1 ']'
+ echo 'PR_CI_JOB set; skipping tidy'
+ SKIP_TIDY='--skip tidy'
+ ../x.py --stage 2 test --skip tidy --skip compiler --skip src
PR_CI_JOB set; skipping tidy
##[group]Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.04s
##[endgroup]
---

---- [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:331: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:331: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:
<<<<<<
        .
        .
        .
      231: define internal noundef zeroext i1 @_RNvXs4_NtNtCs8TJnPFy9MKx_4core5alloc6layoutNtB5_6LayoutNtNtB9_3fmt5Debug3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(16) %self, ptr noalias noundef align 8 dereferenceable(24) %f) unnamed_addr #2 { 
      232: start: 
      233:  %_7 = alloca [8 x i8], align 8 
      234:  %_4 = getelementptr inbounds nuw i8, ptr %self, i64 8 
      235:  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %_7) 
      236:  store ptr %self, ptr %_7, align 8 
      237: ; call <core::fmt::Formatter>::debug_struct_field2_finish 
      238:  %_0 = call noundef zeroext i1 @_RNvMsa_NtCs8TJnPFy9MKx_4core3fmtNtB5_9Formatter26debug_struct_field2_finish(ptr noalias noundef nonnull align 8 dereferenceable(24) %f, ptr noalias noundef nonnull readonly captures(address, read_provenance) @alloc_4d84e70691747edd15f53afa313934fc, i64 noundef 6, ptr noalias noundef nonnull readonly captures(address, read_provenance) @alloc_a2e5f6be2a03b9f5ed256baff3399a84, i64 noundef 4, ptr noundef nonnull %_4, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32) @vtable.3, ptr noalias noundef nonnull readonly captures(address, read_provenance) @alloc_ca8235712f576b69a7b090258b88dda1, i64 noundef 5, ptr noundef nonnull %_7, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32) @vtable.4) 
      239:  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %_7) 
      240:  ret i1 %_0 
      241: } 
      242:  
      243: ; <alloc::collections::TryReserveError as core::fmt::Debug>::fmt 
      244: ; Function Attrs: inlinehint uwtable 
      245: define internal noundef zeroext i1 @_RNvXs8_NtCs5slMqhtyLa4_5alloc11collectionsNtB5_15TryReserveErrorNtNtCs8TJnPFy9MKx_4core3fmt5Debug3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(16) %self, ptr noalias noundef align 8 dereferenceable(24) %f) unnamed_addr #2 { 
      246: start: 
      247:  %_5 = alloca [8 x i8], align 8 
      248:  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %_5) 
      249:  store ptr %self, ptr %_5, align 8 
      250: ; call <core::fmt::Formatter>::debug_struct_field1_finish 
      251:  %_0 = call noundef zeroext i1 @_RNvMsa_NtCs8TJnPFy9MKx_4core3fmtNtB5_9Formatter26debug_struct_field1_finish(ptr noalias noundef nonnull align 8 dereferenceable(24) %f, ptr noalias noundef nonnull readonly captures(address, read_provenance) @alloc_2a1994b61814ef0fbd73d91a08912185, i64 noundef 15, ptr noalias noundef nonnull readonly captures(address, read_provenance) @alloc_a5d866b1768ad3f826bccdb004a1a8ae, i64 noundef 4, ptr noundef nonnull %_5, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32) @vtable.5) 
      252:  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %_5) 
      253:  ret i1 %_0 
      254: } 
      255:  
      256: ; <usize as core::fmt::Debug>::fmt 
      257: ; Function Attrs: inlinehint uwtable 
      258: define internal noundef zeroext i1 @_RNvXsZ_NtNtCs8TJnPFy9MKx_4core3fmt3numjNtB7_5Debug3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(8) %self, ptr noalias noundef align 8 dereferenceable(24) %f) unnamed_addr #2 { 
      259: start: 
      260:  %0 = getelementptr inbounds nuw i8, ptr %f, i64 20 
      261:  %_4 = load i32, ptr %0, align 4, !noundef !5 
      262:  %_3 = and i32 %_4, 33554432 
      263:  %1 = icmp eq i32 %_3, 0 
      264:  br i1 %1, label %bb2, label %bb1 
      265:  
      266: bb2: ; preds = %start 
      267:  %_5 = and i32 %_4, 67108864 
      268:  %2 = icmp eq i32 %_5, 0 
      269:  br i1 %2, label %bb4, label %bb3 
      270:  
      271: bb1: ; preds = %start 
      272: ; call <usize as core::fmt::LowerHex>::fmt 
      273:  %3 = tail call noundef zeroext i1 @_RNvXs6_NtNtCs8TJnPFy9MKx_4core3fmt3numjNtB7_8LowerHex3fmt(ptr noalias noundef nonnull readonly align 8 captures(address, read_provenance) dereferenceable(8) %self, ptr noalias noundef nonnull align 8 dereferenceable(24) %f) 
      274:  br label %bb6 
      275:  
      276: bb4: ; preds = %bb2 
      277: ; call <usize as core::fmt::Display>::fmt 
      278:  %4 = tail call noundef zeroext i1 @_RNvXsi_NtNtNtCs8TJnPFy9MKx_4core3fmt3num3impjNtB9_7Display3fmt(ptr noalias noundef nonnull readonly align 8 captures(address, read_provenance) dereferenceable(8) %self, ptr noalias noundef nonnull align 8 dereferenceable(24) %f) 
      279:  br label %bb6 
      280:  
      281: bb3: ; preds = %bb2 
      282: ; call <usize as core::fmt::UpperHex>::fmt 
      283:  %5 = tail call noundef zeroext i1 @_RNvXs8_NtNtCs8TJnPFy9MKx_4core3fmt3numjNtB7_8UpperHex3fmt(ptr noalias noundef nonnull readonly align 8 captures(address, read_provenance) dereferenceable(8) %self, ptr noalias noundef nonnull align 8 dereferenceable(24) %f) 
      284:  br label %bb6 
      285:  
      286: bb6: ; preds = %bb4, %bb3, %bb1 
      287:  %_0.sroa.0.0.in = phi i1 [ %4, %bb4 ], [ %5, %bb3 ], [ %3, %bb1 ] 
      288:  ret i1 %_0.sroa.0.0.in 
      289: } 
      290:  
      291: ; Function Attrs: uwtable 
      292: define void @should_reserve_once(ptr noalias noundef align 8 captures(none) dereferenceable(24) %v) unnamed_addr #1 personality ptr @rust_eh_personality { 
      293: start: 
      294:  %e.i = alloca [16 x i8], align 8 
      295:  %_6 = load i64, ptr %v, align 8, !noundef !5 
      296:  %_7 = getelementptr inbounds nuw i8, ptr %v, i64 8 
      297:  %self4.i = load i64, ptr %_7, align 8, !range !4, !alias.scope !15, !noundef !5 
      298:  %_11.i = sub i64 %self4.i, %_6 
      299:  %_5.i = icmp ult i64 %_11.i, 3 
      300:  br i1 %_5.i, label %bb1.i, label %_RINvMsj_NtCs5slMqhtyLa4_5alloc3vecINtB6_3VechE14extend_trustedINtNtNtCs8TJnPFy9MKx_4core5array4iter8IntoIterhKj3_EECseHTl9kyFgP7_18vec_reserve_extend.exit 
      301:  
      302: bb1.i: ; preds = %start 
      303: ; call <alloc::raw_vec::RawVecInner>::grow_amortized 
      304:  %0 = tail call fastcc { i64, i64 } @_RNvMs4_NtCs5slMqhtyLa4_5alloc7raw_vecNtB5_11RawVecInner14grow_amortizedCseHTl9kyFgP7_18vec_reserve_extend(ptr noalias noundef nonnull align 8 dereferenceable(16) %_7, i64 noundef %_6, i64 noundef 3) 
      305:  %1 = extractvalue { i64, i64 } %0, 0 
      306:  %.not.i1 = icmp eq i64 %1, -9223372036854775807 
      307:  br i1 %.not.i1, label %_RNvMNtCs8TJnPFy9MKx_4core6resultINtB2_6ResultuNtNtCs5slMqhtyLa4_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit, label %bb2.i 
      308:  
      309: bb2.i: ; preds = %bb1.i 
      310:  %2 = extractvalue { i64, i64 } %0, 1 
      311:  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %e.i) 
      312:  store i64 %1, ptr %e.i, align 8 
      313:  %3 = getelementptr inbounds nuw i8, ptr %e.i, i64 8 
      314:  store i64 %2, ptr %3, align 8 
      315: ; call core::result::unwrap_failed 
      316:  call void @_RNvNtCs8TJnPFy9MKx_4core6result13unwrap_failed(ptr noalias noundef nonnull readonly captures(address, read_provenance) @alloc_00ae4b301f7fab8ac9617c03fcbd7274, i64 noundef 43, ptr noundef nonnull %e.i, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32) @vtable.0, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24) @alloc_19caedb8c5eb5f9ad40d5b34a634ee2c) #12 
      317:  unreachable 
      318:  
      319: _RNvMNtCs8TJnPFy9MKx_4core6resultINtB2_6ResultuNtNtCs5slMqhtyLa4_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit: ; preds = %bb1.i 
      320:  %self5.pre.i = load i64, ptr %_7, align 8, !range !4, !alias.scope !15 
      321:  %.pre.i = sub i64 %self5.pre.i, %_6 
      322:  %4 = icmp ugt i64 %.pre.i, 2 
      323:  %len.i.i.pre = load i64, ptr %v, align 8, !alias.scope !18, !noalias !23 
      324:  %.pre = sub i64 %self5.pre.i, %len.i.i.pre 
      325:  %5 = icmp ult i64 %.pre, 3 
      326:  tail call void @llvm.assume(i1 %4) 
      327:  tail call void @llvm.experimental.noalias.scope.decl(metadata !25) 
      328:  br i1 %5, label %bb1.i.i, label %_RINvMsj_NtCs5slMqhtyLa4_5alloc3vecINtB6_3VechE14extend_trustedINtNtNtCs8TJnPFy9MKx_4core5array4iter8IntoIterhKj3_EECseHTl9kyFgP7_18vec_reserve_extend.exit, !prof !26 
      329:  
      330: bb1.i.i: ; preds = %_RNvMNtCs8TJnPFy9MKx_4core6resultINtB2_6ResultuNtNtCs5slMqhtyLa4_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit 
      331: ; 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
      332:  tail call fastcc void @_RINvNvMs2_NtCs5slMqhtyLa4_5alloc7raw_vecINtB8_11RawVecInnerpE7reserve21do_reserve_and_handleNtNtBa_5alloc6GlobalECseHTl9kyFgP7_18vec_reserve_extend(ptr noalias noundef align 8 dereferenceable(16) %_7, i64 noundef %len.i.i.pre, i64 noundef 3) 
      333:  %_38.pre.i = load i64, ptr %v, align 8, !alias.scope !25, !noalias !23 
      334:  br label %_RINvMsj_NtCs5slMqhtyLa4_5alloc3vecINtB6_3VechE14extend_trustedINtNtNtCs8TJnPFy9MKx_4core5array4iter8IntoIterhKj3_EECseHTl9kyFgP7_18vec_reserve_extend.exit 
      335:  
      336: _RINvMsj_NtCs5slMqhtyLa4_5alloc3vecINtB6_3VechE14extend_trustedINtNtNtCs8TJnPFy9MKx_4core5array4iter8IntoIterhKj3_EECseHTl9kyFgP7_18vec_reserve_extend.exit: ; preds = %start, %bb1.i.i, %_RNvMNtCs8TJnPFy9MKx_4core6resultINtB2_6ResultuNtNtCs5slMqhtyLa4_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit 
      337:  %_38.i = phi i64 [ %_38.pre.i, %bb1.i.i ], [ %len.i.i.pre, %_RNvMNtCs8TJnPFy9MKx_4core6resultINtB2_6ResultuNtNtCs5slMqhtyLa4_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit ], [ %_6, %start ] 
      338:  %6 = getelementptr inbounds nuw i8, ptr %v, i64 16 
      339:  %_37.i = load ptr, ptr %6, align 8, !alias.scope !25, !noalias !23, !nonnull !5, !noundef !5 
      340:  %scevgep.i.i = getelementptr i8, ptr %_37.i, i64 %_38.i 
      341:  store i8 1, ptr %scevgep.i.i, align 1, !noalias !27 
      342:  %_8.sroa.6.16.scevgep.i.i.sroa_idx = getelementptr inbounds nuw i8, ptr %scevgep.i.i, i64 1 
      343:  store i8 2, ptr %_8.sroa.6.16.scevgep.i.i.sroa_idx, align 1, !noalias !27 
      344:  %_8.sroa.7.16.scevgep.i.i.sroa_idx = getelementptr inbounds nuw i8, ptr %scevgep.i.i, i64 2 
      345:  store i8 3, ptr %_8.sroa.7.16.scevgep.i.i.sroa_idx, align 1, !noalias !27 
      346:  %7 = add i64 %_38.i, 3 
      347:  store i64 %7, ptr %v, align 8, !alias.scope !25, !noalias !37 
      348:  ret void 
      349: } 
      350:  
      351: ; Function Attrs: nounwind uwtable 
      352: declare noundef range(i32 0, 10) i32 @rust_eh_personality(i32 noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) unnamed_addr #3 
      353:  
      354: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
      355: declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #4 
      356:  
      357: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) 
      358: declare void @llvm.assume(i1 noundef) #5 
      359:  
      360: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
      361: declare void @llvm.lifetime.end.p0(i64 immarg, ptr captures(none)) #4 
      362:  
      363: ; core::panicking::panic_fmt 
      364: ; Function Attrs: cold noinline noreturn uwtable 
      365: declare void @_RNvNtCs8TJnPFy9MKx_4core9panicking9panic_fmt(ptr noundef nonnull, ptr noundef nonnull, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24)) unnamed_addr #6 
      366:  
      367: ; alloc::raw_vec::handle_error 
      368: ; Function Attrs: cold minsize noreturn optsize uwtable 
      369: declare void @_RNvNtCs5slMqhtyLa4_5alloc7raw_vec12handle_error(i64 noundef range(i64 0, -9223372036854775807), i64) unnamed_addr #7 
      370:  
      371: ; core::panicking::panic 
      372: ; Function Attrs: cold noinline noreturn uwtable 
      373: declare void @_RNvNtCs8TJnPFy9MKx_4core9panicking5panic(ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24)) unnamed_addr #6 
      374:  
      375: ; __rustc::__rust_realloc 
      376: ; Function Attrs: nounwind allockind("realloc,aligned") allocsize(3) uwtable 
      377: declare noalias noundef ptr @_RNvCsl3eLQ9Rb39q_7___rustc14___rust_realloc(ptr allocptr noundef nonnull, i64 noundef, i64 allocalign noundef range(i64 1, -9223372036854775807), i64 noundef) unnamed_addr #8 
      378:  
      379: ; __rustc::__rust_no_alloc_shim_is_unstable_v2 
      380: ; Function Attrs: nounwind uwtable 
      381: declare void @_RNvCsl3eLQ9Rb39q_7___rustc35___rust_no_alloc_shim_is_unstable_v2() unnamed_addr #3 
      382:  
      383: ; __rustc::__rust_alloc 
      384: ; Function Attrs: nounwind allockind("alloc,uninitialized,aligned") allocsize(0) uwtable 
      385: declare noalias noundef ptr @_RNvCsl3eLQ9Rb39q_7___rustc12___rust_alloc(i64 noundef, i64 allocalign noundef range(i64 1, -9223372036854775807)) unnamed_addr #9 
      386:  
      387: ; core::result::unwrap_failed 
      388: ; Function Attrs: cold noinline noreturn uwtable 
      389: declare void @_RNvNtCs8TJnPFy9MKx_4core6result13unwrap_failed(ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noundef nonnull, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32), ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24)) unnamed_addr #6 
      390:  
      391: ; <core::mem::alignment::Alignment as core::fmt::Debug>::fmt 
      392: ; Function Attrs: uwtable 
      393: declare noundef zeroext i1 @_RNvXs_NtNtCs8TJnPFy9MKx_4core3mem9alignmentNtB4_9AlignmentNtNtB8_3fmt5Debug3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(8), ptr noalias noundef align 8 dereferenceable(24)) unnamed_addr #1 
      394:  
      395: ; <core::fmt::Formatter>::debug_struct_field2_finish 
      396: ; Function Attrs: uwtable 
      397: declare noundef zeroext i1 @_RNvMsa_NtCs8TJnPFy9MKx_4core3fmtNtB5_9Formatter26debug_struct_field2_finish(ptr noalias noundef align 8 dereferenceable(24), ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noundef nonnull, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32), ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noundef nonnull, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32)) unnamed_addr #1 
      398:  
      399: ; <core::fmt::Formatter>::debug_struct_field1_finish 
      400: ; Function Attrs: uwtable 
      401: declare noundef zeroext i1 @_RNvMsa_NtCs8TJnPFy9MKx_4core3fmtNtB5_9Formatter26debug_struct_field1_finish(ptr noalias noundef align 8 dereferenceable(24), ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noundef nonnull, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32)) unnamed_addr #1 
      402:  
      403: ; <core::fmt::Formatter>::write_str 
      404: ; Function Attrs: uwtable 
      405: declare noundef zeroext i1 @_RNvMsa_NtCs8TJnPFy9MKx_4core3fmtNtB5_9Formatter9write_str(ptr noalias noundef align 8 dereferenceable(24), ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef) unnamed_addr #1 
      406:  
      407: ; <usize as core::fmt::Display>::fmt 
      408: ; Function Attrs: uwtable 
      409: declare noundef zeroext i1 @_RNvXsi_NtNtNtCs8TJnPFy9MKx_4core3fmt3num3impjNtB9_7Display3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(8), ptr noalias noundef align 8 dereferenceable(24)) unnamed_addr #1 
      410:  
      411: ; <usize as core::fmt::UpperHex>::fmt 
      412: ; Function Attrs: uwtable 
      413: declare noundef zeroext i1 @_RNvXs8_NtNtCs8TJnPFy9MKx_4core3fmt3numjNtB7_8UpperHex3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(8), ptr noalias noundef align 8 dereferenceable(24)) unnamed_addr #1 
      414:  
      415: ; <usize as core::fmt::LowerHex>::fmt 
      416: ; Function Attrs: uwtable 
      417: declare noundef zeroext i1 @_RNvXs6_NtNtCs8TJnPFy9MKx_4core3fmt3numjNtB7_8LowerHex3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(8), ptr noalias noundef align 8 dereferenceable(24)) unnamed_addr #1 
      418:  
      419: ; <core::fmt::Formatter>::pad 
      420: ; Function Attrs: uwtable 
      421: declare noundef zeroext i1 @_RNvMsa_NtCs8TJnPFy9MKx_4core3fmtNtB5_9Formatter3pad(ptr noalias noundef align 8 dereferenceable(24), ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef) unnamed_addr #1 
      422:  
      423: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) 
      424: declare void @llvm.experimental.noalias.scope.decl(metadata) #10 
      425:  
      426: ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) 
      427: declare i64 @llvm.umax.i64(i64, i64) #11 
      428:  
      429: attributes #0 = { cold uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
      430: attributes #1 = { uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
      431: attributes #2 = { inlinehint 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-21/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:331: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:331: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:
<<<<<<
        .
        .
        .
      231: define internal noundef zeroext i1 @_RNvXs4_NtNtCs8TJnPFy9MKx_4core5alloc6layoutNtB5_6LayoutNtNtB9_3fmt5Debug3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(16) %self, ptr noalias noundef align 8 dereferenceable(24) %f) unnamed_addr #2 { 
      232: start: 
      233:  %_7 = alloca [8 x i8], align 8 
      234:  %_4 = getelementptr inbounds nuw i8, ptr %self, i64 8 
      235:  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %_7) 
      236:  store ptr %self, ptr %_7, align 8 
      237: ; call <core::fmt::Formatter>::debug_struct_field2_finish 
      238:  %_0 = call noundef zeroext i1 @_RNvMsa_NtCs8TJnPFy9MKx_4core3fmtNtB5_9Formatter26debug_struct_field2_finish(ptr noalias noundef nonnull align 8 dereferenceable(24) %f, ptr noalias noundef nonnull readonly captures(address, read_provenance) @alloc_4d84e70691747edd15f53afa313934fc, i64 noundef 6, ptr noalias noundef nonnull readonly captures(address, read_provenance) @alloc_a2e5f6be2a03b9f5ed256baff3399a84, i64 noundef 4, ptr noundef nonnull %_4, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32) @vtable.3, ptr noalias noundef nonnull readonly captures(address, read_provenance) @alloc_ca8235712f576b69a7b090258b88dda1, i64 noundef 5, ptr noundef nonnull %_7, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32) @vtable.4) 
      239:  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %_7) 
      240:  ret i1 %_0 
      241: } 
      242:  
      243: ; <alloc::collections::TryReserveError as core::fmt::Debug>::fmt 
      244: ; Function Attrs: inlinehint uwtable 
      245: define internal noundef zeroext i1 @_RNvXs8_NtCs5slMqhtyLa4_5alloc11collectionsNtB5_15TryReserveErrorNtNtCs8TJnPFy9MKx_4core3fmt5Debug3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(16) %self, ptr noalias noundef align 8 dereferenceable(24) %f) unnamed_addr #2 { 
      246: start: 
      247:  %_5 = alloca [8 x i8], align 8 
      248:  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %_5) 
      249:  store ptr %self, ptr %_5, align 8 
      250: ; call <core::fmt::Formatter>::debug_struct_field1_finish 
      251:  %_0 = call noundef zeroext i1 @_RNvMsa_NtCs8TJnPFy9MKx_4core3fmtNtB5_9Formatter26debug_struct_field1_finish(ptr noalias noundef nonnull align 8 dereferenceable(24) %f, ptr noalias noundef nonnull readonly captures(address, read_provenance) @alloc_2a1994b61814ef0fbd73d91a08912185, i64 noundef 15, ptr noalias noundef nonnull readonly captures(address, read_provenance) @alloc_a5d866b1768ad3f826bccdb004a1a8ae, i64 noundef 4, ptr noundef nonnull %_5, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32) @vtable.5) 
      252:  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %_5) 
      253:  ret i1 %_0 
      254: } 
      255:  
      256: ; <usize as core::fmt::Debug>::fmt 
      257: ; Function Attrs: inlinehint uwtable 
      258: define internal noundef zeroext i1 @_RNvXsZ_NtNtCs8TJnPFy9MKx_4core3fmt3numjNtB7_5Debug3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(8) %self, ptr noalias noundef align 8 dereferenceable(24) %f) unnamed_addr #2 { 
      259: start: 
      260:  %0 = getelementptr inbounds nuw i8, ptr %f, i64 20 
      261:  %_4 = load i32, ptr %0, align 4, !noundef !5 
      262:  %_3 = and i32 %_4, 33554432 
      263:  %1 = icmp eq i32 %_3, 0 
      264:  br i1 %1, label %bb2, label %bb1 
      265:  
      266: bb2: ; preds = %start 
      267:  %_5 = and i32 %_4, 67108864 
      268:  %2 = icmp eq i32 %_5, 0 
      269:  br i1 %2, label %bb4, label %bb3 
      270:  
      271: bb1: ; preds = %start 
      272: ; call <usize as core::fmt::LowerHex>::fmt 
      273:  %3 = tail call noundef zeroext i1 @_RNvXs6_NtNtCs8TJnPFy9MKx_4core3fmt3numjNtB7_8LowerHex3fmt(ptr noalias noundef nonnull readonly align 8 captures(address, read_provenance) dereferenceable(8) %self, ptr noalias noundef nonnull align 8 dereferenceable(24) %f) 
      274:  br label %bb6 
      275:  
      276: bb4: ; preds = %bb2 
      277: ; call <usize as core::fmt::Display>::fmt 
      278:  %4 = tail call noundef zeroext i1 @_RNvXsi_NtNtNtCs8TJnPFy9MKx_4core3fmt3num3impjNtB9_7Display3fmt(ptr noalias noundef nonnull readonly align 8 captures(address, read_provenance) dereferenceable(8) %self, ptr noalias noundef nonnull align 8 dereferenceable(24) %f) 
      279:  br label %bb6 
      280:  
      281: bb3: ; preds = %bb2 
      282: ; call <usize as core::fmt::UpperHex>::fmt 
      283:  %5 = tail call noundef zeroext i1 @_RNvXs8_NtNtCs8TJnPFy9MKx_4core3fmt3numjNtB7_8UpperHex3fmt(ptr noalias noundef nonnull readonly align 8 captures(address, read_provenance) dereferenceable(8) %self, ptr noalias noundef nonnull align 8 dereferenceable(24) %f) 
      284:  br label %bb6 
      285:  
      286: bb6: ; preds = %bb4, %bb3, %bb1 
      287:  %_0.sroa.0.0.in = phi i1 [ %4, %bb4 ], [ %5, %bb3 ], [ %3, %bb1 ] 
      288:  ret i1 %_0.sroa.0.0.in 
      289: } 
      290:  
      291: ; Function Attrs: uwtable 
      292: define void @should_reserve_once(ptr noalias noundef align 8 captures(none) dereferenceable(24) %v) unnamed_addr #1 personality ptr @rust_eh_personality { 
      293: start: 
      294:  %e.i = alloca [16 x i8], align 8 
      295:  %_6 = load i64, ptr %v, align 8, !noundef !5 
      296:  %_7 = getelementptr inbounds nuw i8, ptr %v, i64 8 
      297:  %self4.i = load i64, ptr %_7, align 8, !range !4, !alias.scope !15, !noundef !5 
      298:  %_11.i = sub i64 %self4.i, %_6 
      299:  %_5.i = icmp ult i64 %_11.i, 3 
      300:  br i1 %_5.i, label %bb1.i, label %_RINvMsj_NtCs5slMqhtyLa4_5alloc3vecINtB6_3VechE14extend_trustedINtNtNtCs8TJnPFy9MKx_4core5array4iter8IntoIterhKj3_EECseHTl9kyFgP7_18vec_reserve_extend.exit 
      301:  
      302: bb1.i: ; preds = %start 
      303: ; call <alloc::raw_vec::RawVecInner>::grow_amortized 
      304:  %0 = tail call fastcc { i64, i64 } @_RNvMs4_NtCs5slMqhtyLa4_5alloc7raw_vecNtB5_11RawVecInner14grow_amortizedCseHTl9kyFgP7_18vec_reserve_extend(ptr noalias noundef nonnull align 8 dereferenceable(16) %_7, i64 noundef %_6, i64 noundef 3) 
      305:  %1 = extractvalue { i64, i64 } %0, 0 
      306:  %.not.i1 = icmp eq i64 %1, -9223372036854775807 
      307:  br i1 %.not.i1, label %_RNvMNtCs8TJnPFy9MKx_4core6resultINtB2_6ResultuNtNtCs5slMqhtyLa4_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit, label %bb2.i 
      308:  
      309: bb2.i: ; preds = %bb1.i 
      310:  %2 = extractvalue { i64, i64 } %0, 1 
      311:  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %e.i) 
      312:  store i64 %1, ptr %e.i, align 8 
      313:  %3 = getelementptr inbounds nuw i8, ptr %e.i, i64 8 
      314:  store i64 %2, ptr %3, align 8 
      315: ; call core::result::unwrap_failed 
      316:  call void @_RNvNtCs8TJnPFy9MKx_4core6result13unwrap_failed(ptr noalias noundef nonnull readonly captures(address, read_provenance) @alloc_00ae4b301f7fab8ac9617c03fcbd7274, i64 noundef 43, ptr noundef nonnull %e.i, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32) @vtable.0, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24) @alloc_19caedb8c5eb5f9ad40d5b34a634ee2c) #12 
      317:  unreachable 
      318:  
      319: _RNvMNtCs8TJnPFy9MKx_4core6resultINtB2_6ResultuNtNtCs5slMqhtyLa4_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit: ; preds = %bb1.i 
      320:  %self5.pre.i = load i64, ptr %_7, align 8, !range !4, !alias.scope !15 
      321:  %.pre.i = sub i64 %self5.pre.i, %_6 
      322:  %4 = icmp ugt i64 %.pre.i, 2 
      323:  %len.i.i.pre = load i64, ptr %v, align 8, !alias.scope !18, !noalias !23 
      324:  %.pre = sub i64 %self5.pre.i, %len.i.i.pre 
      325:  %5 = icmp ult i64 %.pre, 3 
      326:  tail call void @llvm.assume(i1 %4) 
      327:  tail call void @llvm.experimental.noalias.scope.decl(metadata !25) 
      328:  br i1 %5, label %bb1.i.i, label %_RINvMsj_NtCs5slMqhtyLa4_5alloc3vecINtB6_3VechE14extend_trustedINtNtNtCs8TJnPFy9MKx_4core5array4iter8IntoIterhKj3_EECseHTl9kyFgP7_18vec_reserve_extend.exit, !prof !26 
      329:  
      330: bb1.i.i: ; preds = %_RNvMNtCs8TJnPFy9MKx_4core6resultINtB2_6ResultuNtNtCs5slMqhtyLa4_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit 
      331: ; 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
      332:  tail call fastcc void @_RINvNvMs2_NtCs5slMqhtyLa4_5alloc7raw_vecINtB8_11RawVecInnerpE7reserve21do_reserve_and_handleNtNtBa_5alloc6GlobalECseHTl9kyFgP7_18vec_reserve_extend(ptr noalias noundef align 8 dereferenceable(16) %_7, i64 noundef %len.i.i.pre, i64 noundef 3) 
      333:  %_38.pre.i = load i64, ptr %v, align 8, !alias.scope !25, !noalias !23 
      334:  br label %_RINvMsj_NtCs5slMqhtyLa4_5alloc3vecINtB6_3VechE14extend_trustedINtNtNtCs8TJnPFy9MKx_4core5array4iter8IntoIterhKj3_EECseHTl9kyFgP7_18vec_reserve_extend.exit 
      335:  
      336: _RINvMsj_NtCs5slMqhtyLa4_5alloc3vecINtB6_3VechE14extend_trustedINtNtNtCs8TJnPFy9MKx_4core5array4iter8IntoIterhKj3_EECseHTl9kyFgP7_18vec_reserve_extend.exit: ; preds = %start, %bb1.i.i, %_RNvMNtCs8TJnPFy9MKx_4core6resultINtB2_6ResultuNtNtCs5slMqhtyLa4_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit 
      337:  %_38.i = phi i64 [ %_38.pre.i, %bb1.i.i ], [ %len.i.i.pre, %_RNvMNtCs8TJnPFy9MKx_4core6resultINtB2_6ResultuNtNtCs5slMqhtyLa4_5alloc11collections15TryReserveErrorE6unwrapCseHTl9kyFgP7_18vec_reserve_extend.exit ], [ %_6, %start ] 
      338:  %6 = getelementptr inbounds nuw i8, ptr %v, i64 16 
      339:  %_37.i = load ptr, ptr %6, align 8, !alias.scope !25, !noalias !23, !nonnull !5, !noundef !5 
      340:  %scevgep.i.i = getelementptr i8, ptr %_37.i, i64 %_38.i 
      341:  store i8 1, ptr %scevgep.i.i, align 1, !noalias !27 
      342:  %_8.sroa.6.16.scevgep.i.i.sroa_idx = getelementptr inbounds nuw i8, ptr %scevgep.i.i, i64 1 
      343:  store i8 2, ptr %_8.sroa.6.16.scevgep.i.i.sroa_idx, align 1, !noalias !27 
      344:  %_8.sroa.7.16.scevgep.i.i.sroa_idx = getelementptr inbounds nuw i8, ptr %scevgep.i.i, i64 2 
      345:  store i8 3, ptr %_8.sroa.7.16.scevgep.i.i.sroa_idx, align 1, !noalias !27 
      346:  %7 = add i64 %_38.i, 3 
      347:  store i64 %7, ptr %v, align 8, !alias.scope !25, !noalias !37 
      348:  ret void 
      349: } 
      350:  
      351: ; Function Attrs: nounwind uwtable 
      352: declare noundef range(i32 0, 10) i32 @rust_eh_personality(i32 noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) unnamed_addr #3 
      353:  
      354: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
      355: declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #4 
      356:  
      357: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) 
      358: declare void @llvm.assume(i1 noundef) #5 
      359:  
      360: ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) 
      361: declare void @llvm.lifetime.end.p0(i64 immarg, ptr captures(none)) #4 
      362:  
      363: ; core::panicking::panic_fmt 
      364: ; Function Attrs: cold noinline noreturn uwtable 
      365: declare void @_RNvNtCs8TJnPFy9MKx_4core9panicking9panic_fmt(ptr noundef nonnull, ptr noundef nonnull, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24)) unnamed_addr #6 
      366:  
      367: ; alloc::raw_vec::handle_error 
      368: ; Function Attrs: cold minsize noreturn optsize uwtable 
      369: declare void @_RNvNtCs5slMqhtyLa4_5alloc7raw_vec12handle_error(i64 noundef range(i64 0, -9223372036854775807), i64) unnamed_addr #7 
      370:  
      371: ; core::panicking::panic 
      372: ; Function Attrs: cold noinline noreturn uwtable 
      373: declare void @_RNvNtCs8TJnPFy9MKx_4core9panicking5panic(ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24)) unnamed_addr #6 
      374:  
      375: ; __rustc::__rust_realloc 
      376: ; Function Attrs: nounwind allockind("realloc,aligned") allocsize(3) uwtable 
      377: declare noalias noundef ptr @_RNvCsl3eLQ9Rb39q_7___rustc14___rust_realloc(ptr allocptr noundef nonnull, i64 noundef, i64 allocalign noundef range(i64 1, -9223372036854775807), i64 noundef) unnamed_addr #8 
      378:  
      379: ; __rustc::__rust_no_alloc_shim_is_unstable_v2 
      380: ; Function Attrs: nounwind uwtable 
      381: declare void @_RNvCsl3eLQ9Rb39q_7___rustc35___rust_no_alloc_shim_is_unstable_v2() unnamed_addr #3 
      382:  
      383: ; __rustc::__rust_alloc 
      384: ; Function Attrs: nounwind allockind("alloc,uninitialized,aligned") allocsize(0) uwtable 
      385: declare noalias noundef ptr @_RNvCsl3eLQ9Rb39q_7___rustc12___rust_alloc(i64 noundef, i64 allocalign noundef range(i64 1, -9223372036854775807)) unnamed_addr #9 
      386:  
      387: ; core::result::unwrap_failed 
      388: ; Function Attrs: cold noinline noreturn uwtable 
      389: declare void @_RNvNtCs8TJnPFy9MKx_4core6result13unwrap_failed(ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noundef nonnull, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32), ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(24)) unnamed_addr #6 
      390:  
      391: ; <core::mem::alignment::Alignment as core::fmt::Debug>::fmt 
      392: ; Function Attrs: uwtable 
      393: declare noundef zeroext i1 @_RNvXs_NtNtCs8TJnPFy9MKx_4core3mem9alignmentNtB4_9AlignmentNtNtB8_3fmt5Debug3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(8), ptr noalias noundef align 8 dereferenceable(24)) unnamed_addr #1 
      394:  
      395: ; <core::fmt::Formatter>::debug_struct_field2_finish 
      396: ; Function Attrs: uwtable 
      397: declare noundef zeroext i1 @_RNvMsa_NtCs8TJnPFy9MKx_4core3fmtNtB5_9Formatter26debug_struct_field2_finish(ptr noalias noundef align 8 dereferenceable(24), ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noundef nonnull, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32), ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noundef nonnull, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32)) unnamed_addr #1 
      398:  
      399: ; <core::fmt::Formatter>::debug_struct_field1_finish 
      400: ; Function Attrs: uwtable 
      401: declare noundef zeroext i1 @_RNvMsa_NtCs8TJnPFy9MKx_4core3fmtNtB5_9Formatter26debug_struct_field1_finish(ptr noalias noundef align 8 dereferenceable(24), ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef, ptr noundef nonnull, ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(32)) unnamed_addr #1 
      402:  
      403: ; <core::fmt::Formatter>::write_str 
      404: ; Function Attrs: uwtable 
      405: declare noundef zeroext i1 @_RNvMsa_NtCs8TJnPFy9MKx_4core3fmtNtB5_9Formatter9write_str(ptr noalias noundef align 8 dereferenceable(24), ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef) unnamed_addr #1 
      406:  
      407: ; <usize as core::fmt::Display>::fmt 
      408: ; Function Attrs: uwtable 
      409: declare noundef zeroext i1 @_RNvXsi_NtNtNtCs8TJnPFy9MKx_4core3fmt3num3impjNtB9_7Display3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(8), ptr noalias noundef align 8 dereferenceable(24)) unnamed_addr #1 
      410:  
      411: ; <usize as core::fmt::UpperHex>::fmt 
      412: ; Function Attrs: uwtable 
      413: declare noundef zeroext i1 @_RNvXs8_NtNtCs8TJnPFy9MKx_4core3fmt3numjNtB7_8UpperHex3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(8), ptr noalias noundef align 8 dereferenceable(24)) unnamed_addr #1 
      414:  
      415: ; <usize as core::fmt::LowerHex>::fmt 
      416: ; Function Attrs: uwtable 
      417: declare noundef zeroext i1 @_RNvXs6_NtNtCs8TJnPFy9MKx_4core3fmt3numjNtB7_8LowerHex3fmt(ptr noalias noundef readonly align 8 captures(address, read_provenance) dereferenceable(8), ptr noalias noundef align 8 dereferenceable(24)) unnamed_addr #1 
      418:  
      419: ; <core::fmt::Formatter>::pad 
      420: ; Function Attrs: uwtable 
      421: declare noundef zeroext i1 @_RNvMsa_NtCs8TJnPFy9MKx_4core3fmtNtB5_9Formatter3pad(ptr noalias noundef align 8 dereferenceable(24), ptr noalias noundef nonnull readonly captures(address, read_provenance), i64 noundef) unnamed_addr #1 
      422:  
      423: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) 
      424: declare void @llvm.experimental.noalias.scope.decl(metadata) #10 
      425:  
      426: ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) 
      427: declare i64 @llvm.umax.i64(i64, i64) #11 
      428:  
      429: attributes #0 = { cold uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
      430: attributes #1 = { uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
      431: attributes #2 = { inlinehint uwtable "frame-pointer"="non-leaf" "probe-stack"="inline-asm" "target-cpu"="generic" "target-features"="+v8a,+outline-atomics" } 
        .
        .
        .
>>>>>>
------------------------------------------

@jieyouxu jieyouxu assigned jieyouxu and unassigned nnethercote Apr 14, 2026
Comment on lines -582 to -585
sym::cold_path => {
// This is a no-op. The intrinsic is just a hint to the optimizer.
return Ok(());
}
Copy link
Copy Markdown
Member

@jieyouxu jieyouxu Apr 14, 2026

Choose a reason for hiding this comment

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

@jieyouxu jieyouxu closed this Apr 14, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 14, 2026
@jieyouxu jieyouxu removed their assignment Apr 14, 2026
@apiraino
Copy link
Copy Markdown
Contributor

apiraino commented Apr 14, 2026

@Redslayer112 This is the moderation team of the Rust project. It looks like you used an LLM without reviewing its output sufficiently. This is against our contribution guidelines, it makes reviewing patches a lot of work for us.

If you would like some help with that, please ensure you're familiar with our contribution guidelines, specifically our etiquette and feel free to either reach out to moderation or ask on the Zulip stream for general help from other contributors.

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. 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.

cold_path does not propagate correctly

6 participants