<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 24, 2017, at 12:12 PM, Shobaki, Ghassan <<a href="mailto:ghassan.shobaki@csus.edu" class="">ghassan.shobaki@csus.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div id="divtagdefaultwrapper" dir="ltr" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif, EmojiFont, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class="">Hi Quentin,</div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">Thanks for the reply! However, we are not using any profiling-based compilation in our current work. We are assuming that, if PGO is disabled, the register allocator (and any other pass that needs basic block frequency info) will be basing its decisions on some kind of *static" basic block frequency info that are based on some compile-time heuristics and at least capture loop nesting levels. With such static info, we don't expect see blocks with zero frequency; we expect a block outside all loops to have a frequency of 1 or some small non-zero number. Does LLVM compute such static info?</div></div></div></blockquote><div><br class=""></div><div>Yes, it does.</div><br class=""><blockquote type="cite" class=""><div class=""><div id="divtagdefaultwrapper" dir="ltr" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif, EmojiFont, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class=""> If yes, how do we enable that?</div></div></div></blockquote><div><br class=""></div><div>It should be used by default for the existing allocators. To use in a new pass, you need to request the MachineBlockFrequencyInfo analysis.</div><br class=""><blockquote type="cite" class=""><div class=""><div id="divtagdefaultwrapper" dir="ltr" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif, EmojiFont, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">Thanks</div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">Ghassan Shobaki</div><div style="margin-top: 0px; margin-bottom: 0px;" class="">Assistant Professor of Computer Science<span class="Apple-converted-space"> </span><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">California State University, Sacramento  <span class="Apple-converted-space"> </span><br class=""></div><div style="" class=""><div class=""><div class=""><br class=""><hr tabindex="-1" style="display: inline-block; width: 942.75px;" class=""><div id="x_divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span><a href="mailto:qcolombet@apple.com" class="">qcolombet@apple.com</a> <<a href="mailto:qcolombet@apple.com" class="">qcolombet@apple.com</a>> on behalf of Quentin Colombet <<a href="mailto:qcolombet@apple.com" class="">qcolombet@apple.com</a>><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Wednesday, September 20, 2017 9:44:35 AM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Kerbow, Austin Michael<br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>via llvm-dev<br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [llvm-dev] Spill Weight In InlineSpiller</font><div class=""> </div></div></div><font size="2" class=""><span style="font-size: 10pt;" class=""><div class="PlainText">Hi Austin,<br class=""><br class="">> On Sep 19, 2017, at 11:29 PM, Kerbow, Austin Michael via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class="">><span class="Apple-converted-space"> </span><br class="">> I'm trying to compute and print a weighted spill cost based upon the execution frequency of the basic block where the spill is inserted. My goal is to analyse what effect scheduling changes have on the sum of this weighted spill cost in some benchmarks. I've experimented doing this directly before a spill is inserted in InlineSpiller.cpp using MBFI.getBlockFreq() and LiveIntervals::getSpillWeight. My question is why are these functions sometimes indicating that the frequency of a block, or the weight of a spill is 0? A frequency of 0 doesn't make sense to me.<br class=""><br class="">I don’t know how PGO is implemented in that respect so take it with a grain of salt, but if you’re using PGO, I am guessing that if something is not executed in your training run, you may end up with a 0 frequency.<br class=""><br class="">That being said, I thought we had mechanism to prevent that for happening. Therefore, that sounds like a bug (or you’re looking at an unreachable block?)<br class=""><br class="">Cheers,<br class="">-Quentin<br class=""><br class="">><span class="Apple-converted-space"> </span><br class="">> Thanks,<br class="">><span class="Apple-converted-space"> </span><br class="">> Austin Kerbow<br class="">> _______________________________________________<br class="">> LLVM Developers mailing list<br class="">> <a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">><span class="Apple-converted-space"> </span><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" id="LPlnk3869" previewremoved="true" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></div></span></font></div></div></div></div></blockquote></div><br class=""></body></html>