<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">2021年5月9日 上午3:39,Sriraman Tallam <<a href="mailto:tmsriram@google.com" class="">tmsriram@google.com</a>> 写道:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><br class="Apple-interchange-newline"><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; text-decoration: none;" class=""><div class="gmail_quote" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; text-decoration: none;"><div dir="ltr" class="gmail_attr">On Fri, May 7, 2021 at 10:19 PM 陈云星 <<a href="mailto:chen.yunxing@me.com" class="">chen.yunxing@me.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="auto" class="">can we do not depends on p profiling?<div class=""><br class=""></div><div class="">use hint just like: [unlikely]</div></div></blockquote><div class=""><br class=""></div><div class="">Could you please rephrase?  I think you mean if we could split without profile information?  We don't support that right now and we haven't had much success with that with regards to performance. If you are not using profile-guided builds, you are dropping a lot of performance anyways.</div><div class=""><br class=""></div><div class=""> </div></div></div></blockquote>Yes. Because profile need choice perfect workload, and it maybe hard or infeasible for some software. Which has many workload need to support well and need balance between these workload.<br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; text-decoration: none;"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="auto" class=""><div class=""><br class=""></div><div class="">Which make more controllable for programmers </div><div class=""><br class=""><div dir="ltr" class="">发自我的iPhone</div><div dir="ltr" class=""><br class=""><blockquote type="cite" class="">在 2021年5月8日,上午9:20,Sriraman Tallam <<a href="mailto:tmsriram@google.com" target="_blank" class="">tmsriram@google.com</a>> 写道:<br class=""><br class=""></blockquote></div><blockquote type="cite" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><br class=""></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 7, 2021 at 1:08 PM Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank" class="">rnk@google.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class="">I believe intra-function hot cold code splitting is in the scope of the Propeller project, which Sriram Tallam worked on. I'm not sure what the status of the feature is at this moment.</div></blockquote><div class=""><br class=""></div><div class="">This is available in LLVM with option -fsplit-machine-functions with PGO and it uses PGO profiles to split a function's cold basic blocks which can then be placed arbitrarily.  It is tested on instrumented PGO where it shows gains of a couple of percent.  With Sampled PGO, we are still working on tuning the split.</div><div class=""><br class=""></div><div class="">We have also added support for Propeller, which uses another round of profiling to precisely layout basic blocks and split functions.  While this is more effective that -fsplit-machine-functions, it requires another round of sampled profiling.  Please see the documentation here to optimize binaries with Propeller: <span style="" class="">: </span><a href="https://github.com/google/autofdo/blob/propeller/OptimizeClangO3WithPropeller.md" target="_blank" class="">https://github.com/google/autofdo/blob/propeller/OptimizeClangO3WithPropeller.md</a></div><div class=""><br class=""></div><div class="">Both -fsplit-machine-functions and Propeller use the basic block sections feature to perform function splitting.</div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div class=""><br class=""></div><div class="">I believe that the hot cold split pass is an IR pass, which means that it outlines code at the IR level. This will prevent the register allocator from working across the boundary between hot and cold code, so I don't believe it has as much performance potential as splitting the function during code generation. Looking at the example, I believe GCC is using this strategy, it is not calling outlined code.</div></div></blockquote><div class=""><br class=""></div><div class="">Yep, GCC too splits functions just like -fsplit-machine-functions during code generation and not early like hot cold splitting.  For performance, we have found this more effective.</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 6, 2021 at 2:17 AM chuanqi.xcq via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div class=""><div style="clear: both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class="">Hi,</span></div><div style="clear: both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class=""><br class=""></span></div><div style="clear: both;" class="">IIRC, clang/llvm has HotColdSplit and partial inline passes which has similar functionality. However, these two passes are not enabled by default for some reasons.</div><div style="clear: both;" class=""><br class=""></div><div style="clear: both;" class="">Thanks,</div><div style="clear: both;" class="">Chuanqi</div><div style="clear: both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class=""><br class=""></span></div><blockquote style="margin-right: 0px; margin-top: 0px; margin-bottom: 0px;" class=""><div style="clear: both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class="">------------------------------------------------------------------</span></div><div style="clear: both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class="">From:陈云星 via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>></span></div><div style="clear: both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class="">Send Time:2021年5月6日(星期四) 17:11</span></div><div style="clear: both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class="">To:cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>></span></div><div style="clear: both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class="">Subject:[cfe-dev] split hot and cold part of a function into separate function</span></div><div style="clear: both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class=""><br class=""></span></div>currently, gcc support function attribute “cold”, which can hint compiler split caller function’s cold into two separate function, one is hot the other is cold.<div class=""><br class=""></div><div class="">One example is here: <a href="https://godbolt.org/z/j7sK4hd48" target="_blank" class="">https://godbolt.org/z/j7sK4hd48</a></div><div class=""><br class=""></div><div class="">my question is Clang/llvm has such function/capability ?</div></blockquote><div class=""><br class=""></div></div>_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a><br class=""><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br class=""></blockquote></div></blockquote></div><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div dir="ltr" class=""><div dir="ltr" class=""><span class=""><br class=""><div dir="ltr" align="left" style="margin-left: 0pt;" class=""><table style="border: none; border-collapse: collapse;" class=""><colgroup class=""><col width="111" class=""><col width="158" class=""><col width="190" class=""><col width="16" class=""></colgroup><tbody class=""><tr style="height: 29.25pt;" class=""><td style="border-top-width: 1.5pt; border-top-style: solid; border-top-color: rgb(213, 15, 37); vertical-align: top; padding: 5pt; overflow: hidden;" class=""><div style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-size: 13pt; font-family: Roboto, sans-serif; color: rgb(136, 136, 136); font-weight: 700; vertical-align: baseline; white-space: pre-wrap;" class="">Sri</span><span style="font-size: 12pt; font-family: Roboto, sans-serif; color: rgb(136, 136, 136); vertical-align: baseline; white-space: pre-wrap;" class="">    Tallam |</span></div></td><td style="border-top-width: 1.5pt; border-top-style: solid; border-top-color: rgb(51, 105, 232); vertical-align: top; padding: 5pt; overflow: hidden;" class=""><div style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-size: 12pt; font-family: Roboto, sans-serif; color: rgb(136, 136, 136); vertical-align: baseline; white-space: pre-wrap;" class=""> Software Engineer |</span></div></td><td style="border-top-width: 1.5pt; border-top-style: solid; border-top-color: rgb(0, 153, 57); vertical-align: top; padding: 5pt; overflow: hidden;" class=""><div style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-size: 12pt; font-family: Roboto, sans-serif; color: rgb(136, 136, 136); vertical-align: baseline; white-space: pre-wrap;" class=""> </span><span style="font-size: 12pt; font-family: Roboto, sans-serif; color: rgb(17, 85, 204); vertical-align: baseline; white-space: pre-wrap;" class=""><a href="mailto:tmsriram@google.com" target="_blank" class="">tmsriram@google.com</a></span><span style="font-size: 12pt; font-family: Roboto, sans-serif; color: rgb(136, 136, 136); vertical-align: baseline; white-space: pre-wrap;" class=""> |</span></div></td></tr></tbody></table></div></span><div class=""></div></div></div></div></div></blockquote></div></div></blockquote></div><br clear="all" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; text-decoration: none;" class=""><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; text-decoration: none;" class=""><br class=""></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; text-decoration: none; float: none; display: inline !important;" class="">--<span class="Apple-converted-space"> </span></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; text-decoration: none;" class=""><div dir="ltr" class="gmail_signature" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; text-decoration: none;"><div dir="ltr" class=""><span class=""><br class=""><div dir="ltr" align="left" style="margin-left: 0pt;" class=""><table style="border: none; border-collapse: collapse;" class=""><colgroup class=""><col width="111" class=""><col width="158" class=""><col width="190" class=""><col width="16" class=""></colgroup><tbody class=""><tr style="height: 29.25pt;" class=""><td style="border-top-width: 1.5pt; border-top-style: solid; border-top-color: rgb(213, 15, 37); vertical-align: top; padding: 5pt; overflow: hidden;" class=""><div style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-size: 13pt; font-family: Roboto, sans-serif; color: rgb(136, 136, 136); font-weight: 700; vertical-align: baseline; white-space: pre-wrap;" class="">Sri</span><span style="font-size: 12pt; font-family: Roboto, sans-serif; color: rgb(136, 136, 136); vertical-align: baseline; white-space: pre-wrap;" class="">    Tallam |</span></div></td><td style="border-top-width: 1.5pt; border-top-style: solid; border-top-color: rgb(51, 105, 232); vertical-align: top; padding: 5pt; overflow: hidden;" class=""><div style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-size: 12pt; font-family: Roboto, sans-serif; color: rgb(136, 136, 136); vertical-align: baseline; white-space: pre-wrap;" class=""> Software Engineer |</span></div></td><td style="border-top-width: 1.5pt; border-top-style: solid; border-top-color: rgb(0, 153, 57); vertical-align: top; padding: 5pt; overflow: hidden;" class=""><div style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-size: 12pt; font-family: Roboto, sans-serif; color: rgb(136, 136, 136); vertical-align: baseline; white-space: pre-wrap;" class=""> </span><span style="font-size: 12pt; font-family: Roboto, sans-serif; color: rgb(17, 85, 204); vertical-align: baseline; white-space: pre-wrap;" class=""><a href="mailto:tmsriram@google.com" target="_blank" class="">tmsriram@google.com</a></span><span style="font-size: 12pt; font-family: Roboto, sans-serif; color: rgb(136, 136, 136); vertical-align: baseline; white-space: pre-wrap;" class=""> |</span></div></td></tr></tbody></table></div></span></div></div></div></blockquote></div><br class=""></body></html>