Hi together,
i want to create a map containing a set of aliases for each value.
For example, for a code like:
int main() {
int i;
int *p1 = &i;
int *p2 = &i;
return 0;
}
the map should contain something like:
{i --> (p1, p2),
.....
}
For that, i do followings in my pass:
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
AliasSetTracker *tracker = new AliasSetTracker(AA);
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
tracker->add(*BB);
}
using the print-method of AliasSetTracker, i see:
Alias Set Tracker: 4 alias sets for 4 pointer values.
AliasSet[0x8528d08,1] must alias, Mod Pointers: (i32** %p1, 4)
AliasSet[0x8528d48,1] must alias, Mod Pointers: (i32** %p2, 4)
AliasSet[0x8522d18,1] must alias, Mod/Ref Pointers: (i32* %0, 4)
AliasSet[0x8522d58,1] must alias, Mod/Ref Pointers: (i32* %retval, 4)
can i create this map using the info in AliasSetTracker?
Regards
Raad
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20090315/f35f1f4e/attachment.html>
On Mar 15, 2009, at 6:06 AM, RAAD B wrote:> Hi together, > > i want to create a map containing a set of aliases for each value.I'd suggest checking out the code in lib/Analysis/ AliasAnalysisEvaluator.cpp. It does an all pairs query and prints out the result of each query. Try "opt -aa-eval -print-all-alias-modref- info foo.bc".> > AliasSetTracker *tracker = new AliasSetTracker(AA);I'd recommend against using the AliasSetTracker class if you want good precision. It basically forces a unification approach on top of the underlying AA impl, which pessimizes the results when aliases are not transitive. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090316/7192bbc3/attachment.html>
Apparently Analagous Threads
- Skip redundant checks in AliasSet::aliasesUnknownInst
- [LLVMdev] difference between alias set tracker and alias analysis evaluator
- [LLVMdev] AliasSetTracker and UnknownInst's (callsites mostly) problem
- [LLVMdev] A question about alias analysis
- [LLVMdev] Some questions on the output formats of AliasSetTracker