HomeThat World

common/bitutil: use result of TestBytes to prevent dead code elimination…

Authored by David Chase <drchase@google.com> on Jul 17 2019, 8:23 AM.

Description

common/bitutil: use result of TestBytes to prevent dead code elimination (#19846)

Gollvm has very aggressive dead code elimination that completely
removes one of these two benchmarks. To prevent this, use the
result of the benchmark (a boolean), and to be "fair", make the
transformation to both benchmarks.

To be reliably assured of not removing the code, "use" means
assigning to an exported global. Non-exported globals and
//go:noinline functions are possibly subject to this optimization.

Details

Committed
Felix Lange <fjl@twurst.com>Jul 17 2019, 8:23 AM
Parents
rGETH6bd896a97f0c: eth: add debug_accountRange (#17438)
Branches
Unknown
Tags
Unknown

Event Timeline

Felix Lange <fjl@twurst.com> committed rGETH31a1f164d96b: common/bitutil: use result of TestBytes to prevent dead code elimination… (authored by David Chase <drchase@google.com>).Jul 17 2019, 8:23 AM