<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 1/21/13 5:22 AM, Alexandru Ionut
Diaconescu wrote:<br>
</div>
<blockquote
cite="mid:CAPBXs30EGfJjaoXsmMOm5jtOVtWPgSYJDsfjBKs7rjDTA8+1QQ@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Hello everyone !<br>
<br clear="all">
I am trying to determine for certain Load instructions from my
pass their corresponding Alloca instructions (that can be in other
previous blocks). The chain can be something like :
`TargetLoad(var) -> other stores/loads that use var (or
dependencies on var) -> alloca(var).` , linked on several basic
blocks. Do you know how can I do it?<br>
</blockquote>
<br>
This sounds like an alias analysis query that you're trying to do.
There are a couple of options:<br>
<br>
1) Cycle through all the allocas and ask if they alias with the
loaded pointer. You can use any of the alias analysis
implementations available for LLVM. Alternatively, I think LLVM
might have a class called AliasSetTracker which can do something
similar for you.<br>
<br>
2) Use DSA from the poolalloc project. The DSNodeEquivs pass can be
used to determine if a load and an alloca alias. Depending on your
situation, DSA may give better or worse results than LLVM's current
alias analysis algorithms. I would think that DSA can do a better
job for pointers stored into memory locations. <br>
<br>
-- John T.<br>
<br>
<br>
</body>
</html>