Problems with one pass using another

Hi,

I have two function passes: AvailOut and HashGVN. AvailOut needs to use
HashGVN. And they're built in the same shared object file.

But addRequired<HashGVN> fails with this error:

# opt -load ../../../build/Release/lib/LLVMGVN.so -hashgvn -availout --debug-pass=Structure <basic.s.bc >basic.out.bc
opt: /proj/tbres/shanth/llvm/llvm-1.9/lib/VMCore/PassManagerT.h:387: void
llvm::PassManagerT<Trait>::markPassUsed(const llvm::PassInfo*,
llvm::Pass*) [withTrait = llvm::MTraits]: Assertion `getAnalysisOrNullUp(P) &&
dynamic_cast<ImmutablePass*>(getAnalysisOrNullUp(P)) && "Pass available
but not found! " "Perhaps this is a module pass requiring a function
pass?"' failed.
opt((anonymous namespace)::PrintStackTrace()+0x14)[0x85ebe6c]

Does anyone see what I'm missing?

Thanks,
Prashanth

Hi Prashanth,

Hi Devang,

Based on your limited description, It seems you're running into a
Pass Manager bug.
However, Pass Manager is now re-written in current mainline cvs
sources, so may be you
want to try new pass manager ?

Thanks for the tip.

For now, I'm running them as a single pass. I'll try this sometime and
get back to you.

- Prashanth