[libcxx-commits] [PATCH] D61878: Change how containers are compared

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 10 20:36:40 PDT 2019


zoecarver marked an inline comment as done.
zoecarver added inline comments.


================
Comment at: benchmarks/unordered_set_comp.bench.cpp:217
+        bool val = new_comp(u1, u2);
+        benchmark::DoNotOptimize(val);
+    }
----------------
EricWF wrote:
> I would be very surprised if the compiler wasn't optimizing your benchmark to:
> 
> ```
> bool __cached_val = new_comp(u1, u2);
> while (st.KeepRunning()) {
>   bool val = __cached_val;
>   DoNotOptimize(val);
> }
> ```
Hopefully passing the function directly to `DoNotOptimize` will fix this. Any other suggestions? 


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

https://reviews.llvm.org/D61878





More information about the libcxx-commits mailing list