[PATCH] LLVM CFL Alias Analysis -- Algorithm

George Burgess IV gbiv at google.com
Wed Jul 16 18:38:35 PDT 2014


Hi nlewycky, chandlerc, dberlin,

Note: WeightedBidirectedGraph and StratifiedSets are in their own patch titled "LLVM CFL Alias Analysis -- Supporting Data Structures".

This patch contains the algorithm for the CFL Alias Analysis described here: https://docs.google.com/document/d/1nGFKMmr-HbdEiag9G1GeWurgOV0CweSUjLXFr3LAwqg/edit . Currently, we don't have any extremely fancy features (no interprocedural analysis, no field sensitivity, etc.), and we do best sitting behind BasicAA + TBAA. In such a configuration, we take ~0.6-0.8% of total compile time, and give ~7-8% NoAlias responses to queries TBAA and BasicAA couldn't answer when bootstrapping LLVM. In testing this on other projects, we've seen up to 10.5% of queries dropped by BasicAA+TBAA answered with NoAlias by this algorithm. While an extensive investigation hasn't been conducted, the code being compiled ran properly + passed the unit tests we ran. So, the bugs remaining are probably super subtle. :)

WRT design quirks: 
> This is implemented as an ImmutablePass that holds its own state. Upon making this a FunctionPass, it gets constructed, but nothing ever calls it.

Other notes: 
> Chandler had the idea of making a simple FunctionPass that drops the StratifiedSets cache after inlining. Because AFAICT most of our sets are realized prior to inlining, we'll probably be able to give back better results if we do this.
> I still have ~3.5 weeks of my internship, during which the code will change more, and I'll do extensive testing/profiling. Places I plan to change are noted in the code.

http://reviews.llvm.org/D4551

Files:
  include/llvm/Analysis/Passes.h
  include/llvm/InitializePasses.h
  include/llvm/LinkAllPasses.h
  lib/Analysis/CFLAliasAnalysis.cpp
  lib/Analysis/CMakeLists.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4551.11550.patch
Type: text/x-patch
Size: 26589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140717/9546d118/attachment.bin>


More information about the llvm-commits mailing list