On Apr 7, 2007, at 3:16 PM, Fernando Magno Quintao Pereira wrote:
>
> Dear guys,
>
> I need help fixing a little piece of code. I have a pass that
> I really
> want to execute after the TwoAddressinstructionPass. But if I write
> "AU.addRequiredID(TwoAddressInstructionPassID);" in my pass'
> getAnalysisUsage, I end up getting the infamous:
May be the error message is correct ? Did you check ?
> PassManagerT.h:387: failed assertion `getAnalysisOrNullUp(P) &&
> dynamic_cast<ImmutablePass*>(getAnalysisOrNullUp(P)) &&
"Pass
> available
> but not found! " "Perhaps this is a module pass requiring a
function
> pass?"'
Note, you are using old pass manager, which is completely rewritten
in current CVS sources.
> Well, without requiring TwoAddressPass, LLVM's pass manager
> schedules my
> pass to run before TwoAddress, and, because TwoAddress does not
> preserve
> it, the pass manager call my pass again. That is what I want to avoid.
However, use command line option -debug-pass=Details to understand
why certain pass is preserved or not and who requires what etc...
-
Devang
> I
> wish I could require TwoAddress in my pass. Could someone tell me
> how to
> avoid that error message? My getAnalysis method is:
>
>
> void DefUseSites_Fer::getAnalysisUsage(AnalysisUsage &AU) const {
> AU.addRequired<LoopInfo>();
> // AU.addRequiredID(TwoAddressInstructionPassID);
> AU.addRequired<SplitPhiGroups_Fer>();
> AU.setPreservesAll();
> }
>
>
> Thanks a lot,