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.
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.