rust/library
Andreas Molzer e44784b875 Assume slice len is bounded by allocation size
Uses assume to check the length against a constant upper bound. The
inlined result then informs the optimizer of the sound value range.

This was tried with unreachable_unchecked before which introduces a
branch. This has the advantage of not being executed in sound code but
complicates basic blocks. It resulted in ~2% increased compile time in
some worst cases.

Add a codegen test for the assumption, testing the issue from #67186
2020-10-04 20:43:36 +02:00
..
alloc Auto merge of #77253 - jyn514:crate-link, r=Manishearth 2020-09-29 12:11:17 +00:00
backtrace@4083a90168
core Assume slice len is bounded by allocation size 2020-10-04 20:43:36 +02:00
panic_abort
panic_unwind library/{panic_,}unwind: Add definitions for sparc-unknow-linux-gnu 2020-09-28 00:39:57 +02:00
proc_macro Add a feature gate for basic function pointer use in const fn 2020-09-27 10:46:41 -07:00
profiler_builtins
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Auto merge of #77292 - lzutao:std_asm, r=Amanieu 2020-09-30 05:27:16 +00:00
stdarch@b422b0180f fix redundant delarations of const_fn_transmute 2020-09-27 15:13:32 +08:00
term
test Rollup merge of #77009 - est31:dogfood_total_cmp, r=lcnr 2020-09-21 15:30:49 +02:00
unwind library/{panic_,}unwind: Add definitions for sparc-unknow-linux-gnu 2020-09-28 00:39:57 +02:00