rust/compiler/rustc_hir/src
bors 4573a4a879 Auto merge of #86383 - shamatar:slice_len_lowering, r=bjorn3
Add MIR pass to lower call to `core::slice::len` into `Len` operand

During some larger experiment with range analysis I've found that code like `let l = slice.len()` produces different MIR then one found in bound checks. This optimization pass replaces terminators that are calls to `core::slice::len` with just a MIR operand and Goto terminator.

It uses some heuristics to remove the outer borrow that is made to call `core::slice::len`, but I assume it can be eliminated, just didn't find how.

Would like to express my gratitude to `@oli-obk` who helped me a lot on Zullip
2021-06-21 22:24:13 +00:00
..
arena.rs Revert "Reduce the amount of untracked state in TyCtxt" 2021-06-01 09:05:22 +02:00
def.rs Document Res and its friends 2021-04-07 18:03:38 -07:00
definitions.rs Do not require the DefPathTable to construct the on-disk cache. 2021-06-08 22:23:03 +02:00
hir.rs Remove some last remants of {push,pop}_unsafe! 2021-06-06 17:04:03 -04:00
hir_id.rs Address review comments 2021-03-27 22:16:34 -04:00
intravisit.rs Add support for const operands and options to global_asm! 2021-05-13 22:31:57 +01:00
itemlikevisit.rs Store ForeignItem in a side table. 2020-11-26 21:29:27 +01:00
lang_items.rs Squashed implementation of the pass 2021-06-20 16:09:42 +02:00
lib.rs Remove unused feature gates 2021-05-31 13:55:43 +02:00
pat_util.rs Auto merge of #83599 - jyn514:unorderable, r=Aaron1011 2021-04-03 04:11:35 +00:00
stable_hash_impls.rs Hash DefId in rustc_span. 2021-06-11 12:25:02 +02:00
target.rs Visit more targets when checking attrs 2021-02-09 21:54:46 +01:00
tests.rs Revert "Fix test" 2021-06-07 10:25:32 +02:00
weak_lang_items.rs Fix outdated crate names in compiler docs 2021-04-08 11:12:14 -05:00