[PATCH] D12114: [LPM] Teach the legacy pass manager to support *using* an analysis without *requiring* it.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 13:46:36 PDT 2015


chandlerc created this revision.
chandlerc added a subscriber: llvm-commits.

This let's a pass indicate that it will use an analysis if available
(through getAnalysisIfAvailable). When the pass manager knows this, it
will refrain from deleting that analysis if it can. Naturally, it will
still get invalidated at the correct time. These passes are not
considered when scheduling the pass pipeline, so typically they will
require manual scheduling, but this may also allow passes with
getAnalysisIfAvailable to find the analysis more often if nothing after
them requires that analysis and it wasn't invalidated.

I don't have a particular use case with the current passes, but with my
new structure for alias analyses, this will be very useful. We want to
allow people to customize the set of AAs available by scheduling
additional passes. These's aren't ever *required* for obvious reasons.
So we need some way to mark in the legacy pass manager that they will
still be used if available.

This is essentially how analysis groups already work. But this makes the
feature generally available and more explicit. It should allow the AA
change to not impact how people trigger a custom alias analysis being
available at a certain point in compilation.

http://reviews.llvm.org/D12114

Files:
  include/llvm/IR/LegacyPassManagers.h
  include/llvm/PassAnalysisSupport.h
  lib/IR/LegacyPassManager.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12114.32446.patch
Type: text/x-patch
Size: 7272 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150818/5a0dd20a/attachment.bin>


More information about the llvm-commits mailing list