Before r247167, the pass manager builder controlled which AA
implementations were used, exporting them all in the AliasAnalysis
analysis group.
Now, AAResultsWrapperPass always uses BasicAA, but still uses other
AA implementations if made available in the pass pipeline.
IIUC, one of the many quirks of the legacy pass manager is that we
never actually recomputed BasicAA's dependencies, even though it
requires DT. I'm not sure how that never caused a problem in practice.
But regardless, both SDAG and TwoAddress are required at O0, and really
don't need to be doing fancy optimizations based on useful AA results.
Add a 'NoAAResultsWrapperPass', which just wraps an empty AAResults.
This lets us always provide conservative answers.
Ideally, the decision to use this instead of AAResultsWrapperPass
should live at a higher level, in TargetPassConfig. However, these
passes are already opt-level-aware, and untangling the legacy pass
manager to support adding arbitrary AA passes if the AAResultsWrapper
was required is a huge undertaking (and would basically undo a few
of Chandler's cleanups).
I'm really not sure this is the right approach. WDYT?