<div dir="ltr">Hi,<div><br><div>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:</div><div><br></div><div>Pass 'Remove unreachable machine basic blocks' is not initialized.</div><div>Verify if there is a pass dependency cycle.</div><div>Required Passes:</div><div>~/llvm-3.4/lib/IR/LegacyPassManager.cpp:645: void llvm::PMTopLevelManager::schedulePass(llvm::Pass*): Assertion `PI && "Expected required passes to be initialized"' failed.<br></div><div><br></div><div>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.</div></div><div><br></div><div>How can I add LiveVariables to my FunctionPassManager?</div><div><br></div><div>Best regards,</div><div>Christoph</div></div>