[llvm-dev] Confusing ERROR with LoopAccessLegacyAnalysis: Pass 'Unnamed pass: implement Pass::getPassName()' is not initialized.
Tingyuan LIANG via llvm-dev
llvm-dev at lists.llvm.org
Thu Jan 31 12:18:32 PST 2019
Dear all,
I write a new LoopPass which wants to use passes including LoopInfoWrapperPass, ScalarEvolutionWrapperPass and LoopAccessLegacyAnalysis.
Therefore, I implement the following code based on LLVM 9.0.0:
=====================================================================
bool LoopInformationCollect::runOnLoop(Loop *L, LPPassManager &)
{
auto &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE();
auto &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
// auto *LAA = &getAnalysis<LoopAccessLegacyAnalysis>();
if (Loop_id.find(L)==Loop_id.end()) // traverse instructions in the block assign instruction ID
{
Loop_id[L] = ++Loop_Counter;
}
// *Loop_out << "---------------Loop report----------------\n";
// *Loop_out << LAA->getInfo(L).getReport();
return false;
}
char LoopInformationCollect::ID = 0;
void LoopInformationCollect::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<LoopInfoWrapperPass>();
AU.addRequired<ScalarEvolutionWrapperPass>();
AU.addRequired<LoopAccessLegacyAnalysis>();
AU.setPreservesAll();
}
=====================================================================
I can make the project with GNU make successfully but get the error "Pass 'Unnamed pass: implement Pass::getPassName()' is not initialized." during runtime. When I remove the line "AU.addRequired<LoopAccessLegacyAnalysis>();" and make the project again, I run the program successfully.
Detailed error report is shown below:
---------------------------------------------------------------------------------------------------------
Pass 'Unnamed pass: implement Pass::getPassName()' is not initialized.
Verify if there is a pass dependency cycle.
Required Passes:
Natural Loop Information
Scalar Evolution Analysis
---------------------------------------------------------------------------------------------------------
Please note that I am not using "opt" in the terminal to run the passes but utilize PassManager in a main() function. It seems that the problem is caused by "LoopAccessLegacyAnalysis", since I have not faced this problem with other passes. I am wondering how I can fix this situation.
Thanks a lot for your time and suggestions!
Best regards,
------------------------------------------
Tingyuan LIANG
MPhil Student
Department of Electronic and Computer Engineering
The Hong Kong University of Science and Technology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190131/5b4d4179/attachment.html>
More information about the llvm-dev
mailing list