<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">чт, 8 нояб. 2018 г., 14:45 Markus Lavin <a href="mailto:markus.lavin@ericsson.com">markus.lavin@ericsson.com</a>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div class="m_829352630815205055WordSection1">
<p class="MsoNormal">Fedor,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Yes that is what happens in my case that the loop is fully unrolled and hence ‘removed’.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">My objection though is that there is still IR that could be dumped (i.e. the function containing the loop that was removed or the entire module) and that is what I want to have dumped after each pass when I specify -print-after-all. Of
course there may be certain implementation details that could make this hard to achieve but ideally I would like to have a reliable option that dumps the entire IR (complete enough to import into opt and run additional passes on) after each individual pass
(module, function, loop or whatever).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Doesn’t that make sense?</p></div></div></blockquote></div></div><div dir="auto">It does not agree with the semantics of plain - print-before-all, which intends to prints only the IRunit pass works on. </div><div dir="auto"><br></div><div dir="auto">It does however makes perfect sense for the combo with -print-module-scope.</div><div dir="auto">In fact I was going to try doing that for new-pass-manager implementation.</div><div dir="auto"><br></div><div dir="auto">Legacy one is technically doable as well, though there is a catch that you can't get module out of invalidated Loop, so there needs to be some hackstery employed...</div><div dir="auto"><br></div><div dir="auto">Patches welcome! :) </div><div dir="auto"><br></div><div dir="auto">regards,</div><div dir="auto"> Fedor. </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="m_829352630815205055WordSection1"><p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Regards,<u></u><u></u></p>
<p class="MsoNormal">Markus<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Fedor Sergeev <<a href="mailto:fedor.v.sergeev@gmail.com" target="_blank" rel="noreferrer">fedor.v.sergeev@gmail.com</a>> <br>
<b>Sent:</b> Thursday, November 8, 2018 11:06 AM<br>
<b>To:</b> Markus Lavin <<a href="mailto:markus.lavin@ericsson.com" target="_blank" rel="noreferrer">markus.lavin@ericsson.com</a>><br>
<b>Cc:</b> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a><br>
<b>Subject:</b> Re: [llvm-dev] Completeness of -print-after-all<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Markus,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Loop passes are kinda unique compared to func/module passes in that they could destroy the loop they worked on. And there might be no loop to print after that (btw, there is a known bug in new pass manager where it tries to print deleted
loop in this situation - nothing good happens!).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">In your case loop unroll can fully uroll the loop, essentially removing the Loop. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">If you have suggestions on how to improve behavior in such cases I would be happy to discuss this further. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">regards, <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Fedor <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">8 нояб. 2018 г. 12:38 пользователь "Markus Lavin via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a>> написал:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Hi,<br>
<br>
I recently worked on an issue where I realized that -print-after-all does not<br>
cover all passes run by the pass manager. E.g. it seems that loop passes are<br>
not fully covered and I could find that loop transformations showed up in the<br>
dump of the next non-loop pass (which happened to be 'Combine redundant<br>
instructions' and that was rather confusing).<br>
<br>
Specifying both -print-before-all and -print-after-all and doing some grepping<br>
gives me the following where we see two back-to-back 'Before' dumps which<br>
should not be possible.<br>
<br>
*** IR Dump Before LCSSA Verifier ***<br>
*** IR Dump After LCSSA Verifier ***<br>
*** IR Dump Before Loop-Closed SSA Form Pass ***<br>
*** IR Dump After Loop-Closed SSA Form Pass ***<br>
*** IR Dump Before Unroll loops ***<br>
*** IR Dump Before Combine redundant instructions ***<br>
*** IR Dump After Combine redundant instructions ***<br>
<br>
Maybe there are good reasons for making this hard to fix but to me it seems<br>
like a rather severe deficiency so I wonder if this is widely known and if there<br>
are any plans to improve it?<br>
<br>
-Markus<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank" rel="noreferrer">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></p></blockquote></div>
</div>
</div>
</div>
</div>
</div>
</blockquote></div></div></div>