[LLVMdev] PassManager Woes

dag at cray.com dag at cray.com
Fri Apr 18 15:03:05 PDT 2014


"Daniel Stewart" <stewartd at codeaurora.org> writes:

> I'm no expert on the PassManager, but I happen to be going through it
> fairly carefully right now. You didn't state which passes were Module
> Passes and which were Function Passes (or other types).

Sorry, I did mean to include that.  They are all FunctionPasses.

> One thing I have noticed is that addPreserved() doesn't seem to really
> do anything. I would have thought it would be used in helping
> determine the last users of a pass, but that doesn't appear to be the
> case. It seems to mess with a structure called InheritedAnalysis, but
> that in turn is never really used for anything.

I've also noticed that addPreserved doesn't seem to do anything.  Even
if I say a pass preserves another pass, the other pass gets run again.

> I've noticed that if you have a Module Pass (e.g., GlobalsModRef) that
> is used by a function pass, as long as other function passes require
> AliasAnalysis, it will stick around, even if one of those passes says
> it doesn't preserve AliasAnalysis.

Hmm...that might be related.  The situation here is that an analysis
pass depended on by another analysis pass isn't re-run even though it's
not preserved by any pass.  It sounds like a similar situation.

> As I said, I'm working through the PassManager (LegacyPasssManager.cpp
> specifically) now, so my understanding may be a little off. But there
> does seem to be some odd behavior of the PassManager that I've
> noticed.

As far as I know there is no way to force a re-run of a pass.  Is that
right?

                           -David



More information about the llvm-dev mailing list