[PATCH] D22721: [CFLAA] Add an initial implementation of field-sensitivity to CFLAndersAliasAnalyiss

Jia Chen via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 20:21:44 PDT 2016


grievejia created this revision.
grievejia added reviewers: george.burgess.iv, hfinkel.
grievejia added a subscriber: llvm-commits.

This patch teaches CFLAnders to perform field offset arithmetic when propagating reachability along assignment edges.The only tricky part here is to get the plus/minus signs of those offsets right. Other than that, the analysis logic doesn't need to change too much.

Vurrent implementation should suffice for intra-procedural field-sensitive analysis. Unfortunately if we move to inter-procedural case, the correctness of the analysis is lost. The reason is that our current interprocedural analysis framework can only record ExternalRelations of the form "X = Y + Offset", where X and Y are InterfaceValues. Field-sensitive inter-procedural function summary often encounters relations of the form "*X = *(Y + Offset)", and there is no way to describe such a relation in the function summary without introducing any temporaries. In fact, even if the function summary knows how to describe those relations, for CFLGraph we have the same problem. 

This is not a fundamentally hard problem to solve, but it is annoying in the sense that it's hard to get around it with just simple hacks. I am still figuring out a way to solve the aforementioned problem with as little modification to the current codebase as possible. My intuition is that no matter what I do, the change is not going to be small. So I'll just check in the intraprocedural analysis works to ease the burden of code review. 

https://reviews.llvm.org/D22721

Files:
  lib/Analysis/AliasAnalysisSummary.h
  lib/Analysis/CFLAndersAliasAnalysis.cpp
  lib/Analysis/CFLGraph.h
  test/Analysis/CFLAliasAnalysis/Andersen/gep_basic.ll
  test/Analysis/CFLAliasAnalysis/Andersen/gep_memalias.ll
  test/Analysis/CFLAliasAnalysis/Andersen/gep_unknown.ll
  test/Analysis/CFLAliasAnalysis/Andersen/interproc-ret-arg-gep.ll
  test/Analysis/CFLAliasAnalysis/Andersen/interproc-ret-deref-arg-gep.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22721.65208.patch
Type: text/x-patch
Size: 22541 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160723/a433e1d3/attachment.bin>


More information about the llvm-commits mailing list