An LLVM pass to count the number of dynamic atomic instructions executed.
$ mkdir build
$ cd build
$ LLVM_DIR=<path to llvm build> cmake ..
$ <llvm build>/bin/clang -Xclang -load -Xclang AtomicCounter/build/AtomicCountPass/libLLVMAtomicCount.so test.c test1.c -o test
$ ./test
Atomic Counter: xx