<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"></p>
<p style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; -webkit-text-stroke: rgb(0, 0, 0);">
<span style="font-kerning: none;">Hi Wei-Ren,</span></p>
<p style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; -webkit-text-stroke: rgb(0, 0, 0); min-height: 14px;">
<span style="font-kerning: none;"></span><br>
</p>
<p style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; -webkit-text-stroke: rgb(0, 0, 0);">
<span style="font-kerning: none;">Thanks for your reply. </span></p>
<p style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; -webkit-text-stroke: rgb(0, 0, 0); min-height: 14px;">
<span style="font-kerning: none;"></span><br>
</p>
<p style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; -webkit-text-stroke: rgb(0, 0, 0);">
<span style="font-kerning: none;">I use --debug-pass=Structure and it says Loop access analysis pass is executed before my pass. The interesting part is when I use -mem2reg and -loop-rotate it returns dependence information. I have no idea how to explain that.
 I would be great if one could help me with it. Thanks in advance.</span></p>
<p style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; -webkit-text-stroke: rgb(0, 0, 0); min-height: 14px;">
<span style="font-kerning: none;"></span><br>
</p>
<p style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; -webkit-text-stroke: rgb(0, 0, 0);">
<span style="font-kerning: none;">Best,</span></p>
<p style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica; -webkit-text-stroke: rgb(0, 0, 0);">
<span style="font-kerning: none;">Kewen</span></p>
<br>
<p></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> llvm-dev <llvm-dev-bounces@lists.llvm.org> on behalf of 陳韋任 via llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Sent:</b> Thursday, February 8, 2018 7:06:30 AM<br>
<b>To:</b> Kewen Meng<br>
<b>Cc:</b> LLVM Developers Mailing List<br>
<b>Subject:</b> Re: [llvm-dev] Question about using LoopAccessLegacyAnalysis</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif">Have you check `LoopAccessLegacyAnalysis::runOnFunction` ran as you expect? Besides, I am not sure if <span style="color:rgb(34,34,34); font-family:arial,helvetica,sans-serif; font-size:small; font-style:normal; font-weight:400; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; background-color:rgb(255,255,255); float:none; display:inline">`LoopAccessLegacyAnalysis::runOnFunction`
 does anything useful, have you check that, too?</span></div>
<div class="x_gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
</div>
<div class="x_gmail_extra"><br>
<div class="x_gmail_quote">2018-02-08 1:49 GMT+08:00 Kewen Meng via llvm-dev <span dir="ltr">
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>:<br>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
Hi LLVM community,<br>
<br>
I am writing a custom pass for analyzing the dependence information for the memory access within a loop. I found “LoopAccessLegacyAnalysis” class useful, however I m not able to obtain information from that pass. Here is what I did to get the information:<br>
<br>
// require pass<br>
virtual void getAnalysisUsage(AnalysisUsage &AU) const<br>
    {<br>
         AU.addRequired<<wbr>LoopInfoWrapperPass>();<br>
         AU.addRequired<<wbr>LoopAccessLegacyAnalysis>();<br>
         AU.setPreservesAll();<br>
    }<br>
<br>
// processing<br>
virtual bool runOnFunction(Function &F) {<br>
         LoopInfo &li = getAnalysis<<wbr>LoopInfoWrapperPass>().<wbr>getLoopInfo();<br>
         LoopAccessLegacyAnalysis &lala = getAnalysis<<wbr>LoopAccessLegacyAnalysis>();<br>
<br>
         for(LoopInfo::iterator lp = li.begin(); lp != li.end(); lp++)<br>
         {<br>
             Loop *loop = *lp;<br>
             const LoopAccessInfo &lai = lala.getInfo(loop);<br>
<br>
              // need help here<br>
              // I can’t get any information from the LoopAccessInfo instance.<br>
              errs()<<lai.getNumLoads(); // return 0<br>
          }<br>
}<br>
<br>
<br>
// register<br>
static RegisterPass<SkeletonPass> X("test", "test for using the existing pass",<br>
                                    “false",<br>
                                    “false”);<br>
<br>
<br>
I must be missing something important. Any response would be greatly appreciated!<br>
<br>
Thanks,<br>
Kewen<br>
<br>
<br>
<br>
<br>
Best regards,<br>
Kewen<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="x_gmail_signature">
<div dir="ltr">
<div>Wei-Ren Chen (陳韋任)<br>
Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" target="_blank">https://people.cs.nctu.edu.tw/~chenwj</a></div>
</div>
</div>
</div>
</div>
</body>
</html>