<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Specifically, it looks like on Windows platforms, CMake's default CMAKE_<LANG>_FLAGS_RELWITHDEBINFO include /Ob1, which prevents inline expansion of functions not explicitly marked inline (<a href="https://docs.microsoft.com/en-us/cpp/build/reference/ob-inline-function-expansion">https://docs.microsoft.com/en-us/cpp/build/reference/ob-inline-function-expansion</a>).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">llvm-commits <llvm-commits-bounces@lists.llvm.org> on behalf of Rui Ueyama via llvm-commits <llvm-commits@lists.llvm.org><br>
<b>Reply-To: </b>Rui Ueyama <ruiu@google.com><br>
<b>Date: </b>Monday, January 22, 2018 at 3:26 PM<br>
<b>To: </b>Chandler Carruth <chandlerc@gmail.com><br>
<b>Cc: </b>llvm-commits <llvm-commits@lists.llvm.org><br>
<b>Subject: </b>Re: [llvm] r322595 - Specify inline for isWhitespace in CommandLine.cpp<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">This change was made by a wrong assumption that -DCMAKE_BUILD_TYPE=RelWithDebugInfo would produce the same executable as -DCMAKE_BUILD_TYPE=Release modulo debug info. Turned out that's not true -- it at least disables
 some optimizations such as function inlining. This change doesn't do any harm, but I'll revert it to avoid confusion.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in">On Mon, Jan 22, 2018 at 1:45 PM, Chandler Carruth <<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@gmail.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal" style="margin-left:.5in">Yeah, this really shouldn't be necessary and seems really questionable... I cannot imagine a way that LLVM requires this, and if it LLVM doesn't require this I wonder if we should just move to benchmarking a self-hosted
 LLD rather than worrying about the very detailed performance characteristics with MSCV-built LLD. This seems like a pretty glaring deficiency in the MSVC inliner that we're papering over.<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in">On Mon, Jan 22, 2018 at 9:57 AM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal" style="margin-left:.5in">Is this with a selfhost build? (ie: is clang failing to inline this function where it should) - should we look into why the compiler is failing to catch this case?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:.5in">
<o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in">On Tue, Jan 16, 2018 at 12:53 PM Rui Ueyama via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<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" style="margin-left:.5in">Author: ruiu<br>
Date: Tue Jan 16 12:52:32 2018<br>
New Revision: 322595<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D322595-26view-3Drev&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=JRfkF7cP7jwX_p0nshQi_wg4pHcfFlViNbqR7ZK1ogM&s=Vm9HaBlLA9C9zTVpHW2KpFS1nm3lxXfRuaJpy_wb5AA&e=" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=322595&view=rev</a><br>
Log:<br>
Specify inline for isWhitespace in CommandLine.cpp<br>
<br>
Patch by Takuto Ikuta.<br>
<br>
In chromium's component build, there are many directive sections and<br>
commandline parsing takes much time.<br>
This patch is for speed up of lld in RelWithDebInfo build by forcing<br>
inline heavily called isWhitespace function.<br>
<br>
10 times link perf stats of blink_core.dll changed like below.<br>
<br>
master:<br>
TotalSeconds: 9.8764878<br>
TotalSeconds: 10.1455242<br>
TotalSeconds: 10.075279<br>
TotalSeconds: 10.3397347<br>
TotalSeconds: 9.8361665<br>
TotalSeconds: 9.9544441<br>
TotalSeconds: 9.8960686<br>
TotalSeconds: 9.8877865<br>
TotalSeconds: 10.0551879<br>
TotalSeconds: 10.0492254<br>
Avg: 10.01159047<br>
<br>
with this patch:<br>
TotalSeconds: 8.8696762<br>
TotalSeconds: 9.1021585<br>
TotalSeconds: 9.0233893<br>
TotalSeconds: 9.1886175<br>
TotalSeconds: 9.156954<br>
TotalSeconds: 9.0978564<br>
TotalSeconds: 9.1316824<br>
TotalSeconds: 8.8354606<br>
TotalSeconds: 9.2549431<br>
TotalSeconds: 9.4473085<br>
Avg: 9.11080465<br>
<br>
Modified:<br>
    llvm/trunk/lib/Support/CommandLine.cpp<br>
<br>
Modified: llvm/trunk/lib/Support/CommandLine.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_Support_CommandLine.cpp-3Frev-3D322595-26r1-3D322594-26r2-3D322595-26view-3Ddiff&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=JRfkF7cP7jwX_p0nshQi_wg4pHcfFlViNbqR7ZK1ogM&s=c_5_O0wtNPhV0wUsZneTQz5qMJOScKgSTfCJrfSsdyY&e=" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=322595&r1=322594&r2=322595&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Support/CommandLine.cpp (original)<br>
+++ llvm/trunk/lib/Support/CommandLine.cpp Tue Jan 16 12:52:32 2018<br>
@@ -688,7 +688,7 @@ static bool EatsUnboundedNumberOfValues(<br>
          O->getNumOccurrencesFlag() == cl::OneOrMore;<br>
 }<br>
<br>
-static bool isWhitespace(char C) {<br>
+static inline bool isWhitespace(char C) {<br>
   return C == ' ' || C == '\t' || C == '\r' || C == '\n';<br>
 }<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=JRfkF7cP7jwX_p0nshQi_wg4pHcfFlViNbqR7ZK1ogM&s=PmT80Pe7_nbc-iU6QthOcKi2rAAu7Iq61aaC25iVSNg&e=" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</div>
</body>
</html>