Commits


Chris Kennelly authored and GitHub committed 53df805dc82
Deprecate constant reference API to DoNotOptimize. (#1493) The compiler assume that a constant reference, even though escaped via asm volatile, is unchanged. The const-ref interface is deprecated to discourage new uses of it, as subtle compiler optimizations (invariant hoisting, etc.) can occur. Within microbenchmarks for Abseil's hashtables, BM_FindMiss_Hot (https://github.com/google/fleetbench/blob/c0eaa90671d6cc99eb065864e74f0175bee24a5d/fleetbench/swissmap/hot_swissmap_benchmark.cc#L48) has a `const uint32_t key` is passed to to the lookup of a hashtable. With the `key` marked `const`, LLVM hoists part of the lookup calculation outside of the loop. With the `const` removed, this hoisting does not occur. Co-authored-by: Dominic Hamon <dominichamon@users.noreply.github.com> Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>