[llvm-dev] [compiler-rt] Improve atomic locking?

Paul Peet via llvm-dev llvm-dev at lists.llvm.org
Thu Dec 29 15:20:58 PST 2016


Hey,

I am wondering if there wouldn't be more room for improving the
locking of a pointer when an atomic operation is being made since I've
noticed that one could increase the SPINLOCK_COUNT in
lib/builtins/atomic.c to (1 << 13) which is a 8x increase of available
locks if we also change the type of the atomic lock which currently is
uintptr_t to a single byte (uint8_t) which I think is more appropriate
since the lock can only have two states for other systems than
freebsd, macos.

Am I missing something? This seems like choosing uintptr_t was intentional.

~ Paul


More information about the llvm-dev mailing list