<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi all,<div class="">I’m working on my thesis in which I need to count the number of memory access (i.e. load and stores) of each variable of program. how can I do that? these are some approaches came to my mind : </div><div class=""><ul class="MailOutline"><li class="">I need to know during the execution of the program how many load and store instructions are executed on a specific variable, hence simply counting static load and store instructions doesn’t help. </li><li class="">I also cannot write an IR pass to inject some instructions to count memory accesses of variables (instrumenting) , because in IR optimization I’m not aware of what will happen in register allocation. </li><li class="">And if I write a machine pass to inject machine instructions, I guess maybe I loose some informations( e.g. variable names) during the optimizations.</li></ul><div class=""><br class=""></div><div class="">Thanks,</div><div class="">MohammadKazem </div><div class=""><br class=""></div></div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>