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

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 14:06:03 PDT 2015


hfinkel added a subscriber: hfinkel.
hfinkel added a comment.

This seems really nice; if I understand correctly what this does, it fixes a long-standing bug (assuming that the passes themselves are updated). I recall writing workarounds in regression tests like this (in test/Transforms/InstCombine/assume-loop-align.ll):

  ; RUN: opt -domtree -instcombine -loops -S < %s | FileCheck %s
  ; Note: The -loops above can be anything that requires the domtree, and is
  ; necessary to work around a pass-manager bug.

(I don't know if we currently have a good example in a regression test because, since instcombine was changed to require a domtree, the workaround in this specific test should no longer be necessary).


================
Comment at: include/llvm/PassAnalysisSupport.h:95
@@ +94,3 @@
+  template<class PassClass>
+  AnalysisUsage &addUsed() {
+    Used.push_back(&PassClass::ID);
----------------
Should we call this addUsedIfAvailable, or similar, to make it clearer what this does (and, specifically, how it differs from addRequired)?



http://reviews.llvm.org/D12114





More information about the llvm-commits mailing list