Question on store instrumentation using llvm

First, I am someone who is knew to llvm and the reason I am
posting this question to this list is for some guidance from the
people who know llvm best. I am working on a research project
that requires me to instrument all global lock context store. I
have been looking into to using llvm and its IR to achieve this.
Before I go ahead and attempt this I was wondering if the people
who work on this could suggest if this has already been done and
I am failing to see the elephant in the room. If this has not
been done any hints on the best approach would be greatly

I am not subscribed to the list, would appreciate it if I am
copied on the response.