[llvm-dev] Enable STATISTIC all the time again?

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Wed Jun 7 16:18:13 PDT 2017


On Sun, Jun 04, 2017 at 10:09:42AM +0100, James Courtier-Dutton wrote:
> Why can't you have thread local stats, thus not requiring any locking, and
> then add all the thread local stats up at the end, once the threads have
> finished?

Depending on the architecture, getting the thread base register involves
a special trap or other expensive magic. At least for a single-threaded
clang, that's much more expensive than an atomic if it can't be moved
early enough and amortized aggressively by the compiler.

Joerg


More information about the llvm-dev mailing list