PhoenixMicroBenchmark  1.3.0
Toolset for function micro-benchmarking
Loading...
Searching...
No Matches
PFunctionTimer_impl.h File Reference
Include dependency graph for PFunctionTimer_impl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<class T>
void benchmark_doNotOptimize (T &value)
 Prevent compiler from optimising a loop.

Function Documentation

◆ benchmark_doNotOptimize()

template<class T>
void benchmark_doNotOptimize ( T & value)
inline

Prevent compiler from optimising a loop.

Parameters
value: reference to a value

Definition at line 19 of file PFunctionTimer_impl.h.

19 {
20#if defined(__clang__)
21 asm volatile("" : "+r,m"(value) : : "memory");
22#else
23 asm volatile("" : "+m,r"(value) : : "memory");
24#endif
25}

Referenced by PFunctionTimer::evalPerf().

Here is the caller graph for this function: