LLVM Pass - Backend or IR

Hello all,

I am a beginner to LLVM. I tested some available passes on the Internet. I have not started writing the pass yet, I am just wondering about some design organization in which I need some help.

I would like to instrument my code to get offset of all ARM branch instructions (either a jump, call or ret). I was thinking of making a pass at the backend once the LLVM bitcode has been transformed into the target dependent code and no target dependent optimization has been done. So, my idea was to determine all branches in ARM backend and add a store instruction just before the branch. What I cannot understand is how can I control the address of these stores. I want to control this offset address precisely. Is it possible to do ?

What would be the best way to do this instrumentation ?
Any tips or recommendations are appreciated. Thank you very much for your time and help.

Best Regards,
MAW