diff options
| author | Andreas Molzer <andreas.molzer@gmx.de> | 2020-09-20 17:22:17 +0200 |
|---|---|---|
| committer | Andreas Molzer <andreas.molzer@gmx.de> | 2020-10-04 20:43:36 +0200 |
| commit | e44784b8750016a695361c990024750e037d8f9f (patch) | |
| tree | 60652ccb46cce808024badc56173593400be44a4 /compiler/rustc_mir/src/transform/coverage/debug.rs | |
| parent | d92d28e523bf056ab4eb752510ec52fe4f1c6311 (diff) | |
| download | rust-e44784b8750016a695361c990024750e037d8f9f.tar.gz rust-e44784b8750016a695361c990024750e037d8f9f.zip | |
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
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/debug.rs')
0 files changed, 0 insertions, 0 deletions
