<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dear all,<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
    I write a new LoopPass which wants to use passes including LoopInfoWrapperPass, ScalarEvolutionWrapperPass and LoopAccessLegacyAnalysis.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
    Therefore, I implement the following code based on LLVM 9.0.0:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
=====================================================================</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>bool LoopInformationCollect::runOnLoop(Loop *L, LPPassManager &) <br>
</span>
<div>{<br>
</div>
<div><br>
</div>
<div>    auto &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE();<br>
</div>
<div>    auto &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo();<br>
</div>
<div>    // auto *LAA = &getAnalysis<LoopAccessLegacyAnalysis>();<br>
</div>
<div>    if (Loop_id.find(L)==Loop_id.end()) // traverse instructions in the block assign instruction ID<br>
</div>
<div>    {<br>
</div>
<div>        Loop_id[L] = ++Loop_Counter;<br>
</div>
<div>    }<br>
</div>
<div>    // *Loop_out << "---------------Loop report----------------\n";<br>
</div>
<div>    // *Loop_out << LAA->getInfo(L).getReport();<br>
</div>
<div>    return false;<br>
</div>
<div>}<br>
</div>
<div><br>
</div>
<div>char LoopInformationCollect::ID = 0;  <br>
</div>
<div><br>
</div>
<div>void LoopInformationCollect::getAnalysisUsage(AnalysisUsage &AU) const {<br>
</div>
<div>    AU.addRequired<LoopInfoWrapperPass>();<br>
</div>
<div>    AU.addRequired<ScalarEvolutionWrapperPass>();<br>
</div>
<div>    AU.addRequired<LoopAccessLegacyAnalysis>();<br>
</div>
<div>    AU.setPreservesAll();<br>
</div>
<span>}</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
=====================================================================</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
   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. <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
   Detailed error report is shown below:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
---------------------------------------------------------------------------------------------------------<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>Pass 'Unnamed pass: implement Pass::getPassName()' is not initialized.<br>
</span>
<div>Verify if there is a pass dependency cycle.<br>
</div>
<div>Required Passes:<br>
</div>
<div>        Natural Loop Information<br>
</div>
<span>        Scalar Evolution Analysis</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
---------------------------------------------------------------------------------------------------------<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
   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.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
   Thanks a lot for your time and suggestions!<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<span id="ms-rterangepaste-start"></span>
<div><font size="2" face="Calibri,sans-serif"><span style="font-size:12pt">Best regards,</span></font><span style="font-size:12pt">
</span><span style="font-size:12pt"></span>
<div><span style="font-size:12pt"></span>
<div style="margin:0"><font size="2" face="Calibri,sans-serif"><span style="font-size:12pt">------------------------------------------</span></font></div>
<span style="font-size:12pt"></span></div>
<span style="font-size:12pt"></span>
<div><span style="font-size:12pt"></span>
<div style="margin:0"><font size="2" face="Calibri,sans-serif"><span style="font-size:12pt">Tingyuan LIANG</span></font></div>
<span style="font-size:12pt"></span></div>
<span style="font-size:12pt"></span>
<div><span style="font-size:12pt"></span>
<div style="margin:0"><font size="2" face="Calibri,sans-serif"><span style="font-size:12pt">MPhil Student</span></font></div>
<span style="font-size:12pt"></span></div>
<span style="font-size:12pt"></span>
<div><span style="font-size:12pt"></span>
<div style="margin:0"><font size="2" face="Calibri,sans-serif"><span style="font-size:12pt">Department of Electronic and Computer Engineering</span></font></div>
<span style="font-size:12pt"></span></div>
<span style="font-size:12pt"></span>
<div><span style="font-size:12pt"></span>
<div style="margin:0"><font size="2" face="Calibri,sans-serif"><span style="font-size:12pt">The Hong Kong University of Science and Technology</span></font></div>
<span style="font-size:12pt"></span></div>
<span style="font-size:12pt"></span></div>
<span style="font-size:12pt"></span><span style="font-size:12pt"></span><span id="ms-rterangepaste-end"></span></div>
</div>
</body>
</html>