[LLVMdev] Pass management

Fernando Magno Quintao Pereira fernando at CS.UCLA.EDU
Sat Apr 7 15:16:05 PDT 2007

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:

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 

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. 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.addRequiredID(TwoAddressInstructionPassID);

Thanks a lot,


More information about the llvm-dev mailing list