<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 13, 2016 at 1:39 PM, Teresa Johnson <span dir="ltr"><<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Oct 13, 2016 at 10:35 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron.ballman@gmail.com" target="_blank">aaron.ballman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Thu, Oct 13, 2016 at 1:30 PM, Mehdi AMINI <<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>> wrote:<br>
> mehdi_amini added inline comments.<br>
><br>
><br>
> ================<br>
> Comment at: lib/Support/Host.cpp:1239<br>
> +// On other systems, return -1 to indicate unknown.<br>
> +int computeHostNumPhysicalCores() { return -1; }<br>
> +#endif<br>
> ----------------<br>
> aaron.ballman wrote:<br>
>> No Windows implementation? Should be able to use `GetLogicalProcessorInformatio<wbr>n()` pretty easily.<br>
>><br>
>> <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms683194(v=vs.85).aspx" rel="noreferrer" target="_blank">https://msdn.microsoft.com/en-<wbr>us/library/windows/desktop/ms6<wbr>83194(v=vs.85).aspx</a><br>
> Patch welcome :)<br>
<br>
</span>Happy to work on a patch, but I worry when we add new interfaces that<br>
don't work across platforms unless they bark loudly. An assert() here<br>
might not be amiss.<br></blockquote><div><br></div></span><div>I don't want to add an assert, because when I submit the follow-on patch that uses this in a new thread interface it will fall back to hardware_concurrency if this returns -1. This seems like a friendlier approach, since for all platforms but the ones implemented here it will cause the user (ThinLTO backends initially) to fall back to the current default parallelism. And they will then automatically pick up any support added for other platforms.</div></div></div></div></blockquote><div><br></div><div>Okay, that's totally fair. Thank you for the explanation!</div><div><br></div><div>~Aaron</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="m_9107519605006584248HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span><div class="m_9107519605006584248HOEnZb"><div class="m_9107519605006584248h5"><br>
><br>
> I'll supply the MacOS version when possible.<br>
><br>
><br>
> <a href="https://reviews.llvm.org/D25564" rel="noreferrer" target="_blank">https://reviews.llvm.org/D2556<wbr>4</a><br>
><br>
><br>
><br>
</div></div></blockquote></span></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_9107519605006584248gmail_signature" data-smartmail="gmail_signature"><span style="font-family:Times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Teresa Johnson |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> 408-460-2413</td></tr></tbody></table></span></div>
</font></span></div></div>
</blockquote></div><br></div></div>