[LLVMdev] How to add LiveVariables pass

e e hasnoadditives at gmail.com
Thu Oct 2 09:15:49 PDT 2014


Hi,

In LLVM 3.4 using C++ API I would like to track which physical registers
are live. Therefore I want to add a LiveVariables pass to
FunctionPassManager. However I get this failed assertion:

Pass 'Remove unreachable machine basic blocks' is not initialized.
Verify if there is a pass dependency cycle.
Required Passes:
~/llvm-3.4/lib/IR/LegacyPassManager.cpp:645: void
llvm::PMTopLevelManager::schedulePass(llvm::Pass*): Assertion `PI &&
"Expected required passes to be initialized"' failed.

Looking into CodeGen/UnreachableBlockElim.cpp I find that 'Remove
unreachable machine basic blocks' is the name
of UnreachableMachineBlockElim, for which exists a function prototype 'void
initializeUnreachableMachineBlockElimPass(PassRegistry&);' in
InitializePasses.h. Calling that function (for which I don't see any
implementation...) with llvm::PassRegistry::getPassRegistry() before adding
LiveVariables to the pass manager still results in the same failed
assertion. Creating an instance of UnreachableMachineBlockElim is not
possible because the class is not declared in a header file and therefore
not visible to the compiler.

How can I add LiveVariables to my FunctionPassManager?

Best regards,
Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141002/e39e71f7/attachment.html>


More information about the llvm-dev mailing list