about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorAndreas Molzer <andreas.molzer@gmx.de>2020-09-20 17:22:17 +0200
committerAndreas Molzer <andreas.molzer@gmx.de>2020-10-04 20:43:36 +0200
commite44784b8750016a695361c990024750e037d8f9f (patch)
tree60652ccb46cce808024badc56173593400be44a4 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parentd92d28e523bf056ab4eb752510ec52fe4f1c6311 (diff)
downloadrust-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 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions