[PATCH] D64082: [MemFunctions] Add microbenchmarks for memory functions.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 02:48:50 PDT 2019


lebedev.ri added inline comments.


================
Comment at: MicroBenchmarks/MemFunctions/main.cpp:43
+  benchmark::DoNotOptimize(q_storage);
+
+  for (auto _ : state) {
----------------
This may be paranoia, but i'm not sure this is sufficient to guarantee that compiler *can't* just look into `p`/`q`.
I'd suggest adding this here:
```
  benchmark::DoNotOptimize(p);
  benchmark::DoNotOptimize(q);

  benchmark::ClobberMemory(p);
  benchmark::ClobberMemory(q);
```
(i see that you do that for `std::vector<char>`'s already, but you have already acquired `_storage.data()`..)


Repository:
  rT test-suite

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64082/new/

https://reviews.llvm.org/D64082





More information about the llvm-commits mailing list