[LLVMdev] How to analyze where the address comes from?

Ruiling Song ruiling.song83 at gmail.com
Wed Nov 19 00:54:27 PST 2014


Hi,

I want to get the information where the address of load/store comes from,
like below load instruction, %152 may come from a getelementpr, or comes
from some gep+ptrtoint+add+inttoptr... instructions. what's the recommended
way to find the original memory pointer?

  %153 = load <2 x i16> addrspace(1)* %152, align 2

going through the use-def chain seems not easy, because the 'add' operation
contains two operands, one come from a pointer, the other is an integer
offset. I could not know which is at operand 0 and which is at operand 1.

Thanks!
Ruiling
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141119/419f63df/attachment.html>


More information about the llvm-dev mailing list