getting all def-uses


  I want to get all the d-u pairs exercised at run-time. I am doing
two things for this. I am useing the d-u iterator to instrument all uses.
I also want to get an address trace. What are the instructions I should
insttrument. Is load and store sufficient. Also, how do I go abt doing
this ?


Hi Sriraman,

If you are looking for accessed memory locations, instrumenting loads and stores should be sufficient. To do this, just walk to program (e.g. all BB's in a function, all instructions in a BB) and for each load and store instruction insert trace code.

Let me know if this doesn't make sense or if I misunderstood the issue,


Thanks Chris. Yes that was what I was looking for.


vaarg accesses memory too.

Note also that the back end code generators can generate other memory accesses and those won't be visible at the LLVM level. These include spill code, argument passing through the stack, any code generated internally for intrinsics or for exceptions on unwind, and of course any native run-time libraries like malloc/free.