<div dir="ltr">For the new pass manager, `opt --print-changed(=quiet)` is very nice for filtering out passes that didn't do anything. You could add something to StandardInstrumentations to do something besides just printing the IR out when it changes.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 24, 2021 at 1:52 PM Stefanos Baziotis via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Min,<div><br></div><div>Honestly, I don't think optimization remarks are good to check _whether_ a pass did any work. A far better option, to the best of my knowledge, is, as I mentioned, the --print-after-all family [1]</div><div>Optimization remarks may help on the last question I posed and that is to check _why_ a transformation was not applied. Although, if one reaches this point, they will need to use way more</div><div>tools than remarks.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> And even for the Passes that use it, my impression was that not every predicates are annotated with optimization remarks.</blockquote><div><br></div><div>Definitely not and a lot of remarks are not that descriptive either.<br></div><div><br></div><div>Best,</div><div>Stefanos</div><div><br></div><div>[1] <a href="https://godbolt.org/z/58Ms7qW4s" target="_blank">https://godbolt.org/z/58Ms7qW4s</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Στις Δευ, 24 Μαΐ 2021 στις 11:07 μ.μ., ο/η Min-Yih Hsu <<a href="mailto:minyihh@uci.edu" target="_blank">minyihh@uci.edu</a>> έγραψε:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>I think optimization remarks is a good framework for measuring whether a Pass does any work.<div>But unfortunately it is not widely adopted by Passes outside loop transformations. And even for the Passes that use it, my impression was that not every predicates are annotated with optimization remarks.</div><div><br></div><div>-Min<br><div><br><blockquote type="cite"><div>On May 24, 2021, at 12:55 PM, Stefanos Baziotis via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><div dir="ltr">Hi,<div><br></div><div>Has anyone gathered statistics on reference workloads (*) for (transformation) passes</div><div>that are enabled / run by default (e.g., -O3) but most of the</div><div>time _don't_ do any effective transformation?</div><div>Even better if we also have such statistics for passes that are _not_ enabled by default</div><div>(e.g., loop fusion, distribution, interchange, NewGVN).</div><div><br></div><div>And yet even better if people have some idea / data for the reason for ineffectiveness.</div><div>Bad heuristics / decision-making? Are some of these transformations useless most of the time?</div><div>Or maybe they are useful but their implementation in LLVM is not powerful enough. Or maybe</div><div>they incur a significant compile-time overhead.</div><div><br></div><div>If not, it would also be helpful if anyone who has tried gathering similar statistics has any</div><div>advice on how to approach it (my rough idea is initially</div><div>use --print-changed / --print-after-all on these workloads for -O3 and then try to</div><div>slide in passes that are not enabled by default; although that's harder to do it right).</div><div><br></div><div>@Hideto: In the last LLVM meeting you gave a related talk [1]. Do you maybe have<br></div><div>the full statistics and / or ways to reproduce them?</div><div><br></div><div>Best,</div><div>Stefanos</div><div><br></div><div>(*)  SPEC, Polybench, Cryptographic libraries, Genome alignment, Image Processing, Graph Processing, Web browsers, databases like sqlite etc.</div><div><br></div><div>[1] <a href="https://www.youtube.com/watch?v=QvF68tOt_w8" target="_blank">https://www.youtube.com/watch?v=QvF68tOt_w8</a></div></div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br></div></blockquote></div><br></div></div></blockquote></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>