You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
do_not_optimize(v) keeps the work producing v inside the span. A result held in a
register and read only after end() could be computed after the closing timestamp, and
GCC, Clang and MSVC all did that at -O2. Free on GCC and Clang. On MSVC it costs one
stack store, plus a load for a non-const v.
slick-perfmon-stamp_order test, which checks the order of work and stamps in the
compiled code.
Fixed
The compiler could move memory operations across a fenced stamp, so a span could time
less than its work. GCC and MSVC move them across RDTSCP, MSVC treats LFENCE as a
load-only barrier, and MSVC removed a span's stores outright. Compiler barriers now go
before every fenced stamp and after the closing one: a one-byte nop each on MSVC
(three per begin/end pair), nothing elsewhere.