<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Support/Windows/Threading.inc, branch users/nico/python-1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[Support] Include Support/thread.h before api implementations (#111175)</title>
<updated>2024-10-10T04:45:29+00:00</updated>
<author>
<name>Thomas Fransham</name>
<email>tfransham@gmail.com</email>
</author>
<published>2024-10-10T04:45:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9093ba9f7ee58ccf62e58487a5028707a248c0b7'/>
<id>9093ba9f7ee58ccf62e58487a5028707a248c0b7</id>
<content type='text'>
This header was included after the implementations to work around an
issue with FreeBSD, however, , this causes some issues when
dllexport\explicit visibility
attributes will be added to the headers on Windows, since the
definitions need to see the declarations for the attributes to apply.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and plugins on
windows.

---------

Co-authored-by: Tom Stellard &lt;tstellar@redhat.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This header was included after the implementations to work around an
issue with FreeBSD, however, , this causes some issues when
dllexport\explicit visibility
attributes will be added to the headers on Windows, since the
definitions need to see the declarations for the attributes to apply.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and plugins on
windows.

---------

Co-authored-by: Tom Stellard &lt;tstellar@redhat.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[Support] Use llvm::popcount (NFC)</title>
<updated>2023-02-12T21:39:18+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2023-02-12T21:39:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=15cb5ebed7a45002abb617600ca1d6609b0dc5a9'/>
<id>15cb5ebed7a45002abb617600ca1d6609b0dc5a9</id>
<content type='text'>
This should fix builds on Windows.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This should fix builds on Windows.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Support] On Windows 11 and Windows Server 2022, fix an affinity mask issue on large core count machines</title>
<updated>2023-01-06T22:03:43+00:00</updated>
<author>
<name>Alexandre Ganea</name>
<email>alex_toresh@yahoo.fr</email>
</author>
<published>2023-01-05T20:27:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e66500c7749578cf5e1372d0b52781259cb1fa28'/>
<id>e66500c7749578cf5e1372d0b52781259cb1fa28</id>
<content type='text'>
Before Windows 11 and Windows Server 2022, only one 'processor group' is assigned by default to a starting process, then the program is responsible for dispatching its own threads on more 'processor groups'. That is what 8404aeb56a73ab24f9b295111de3b37a37f0b841 was doing, allowing LLVM tools to automatically use all hardware threads in the machine.

After Windows 11 and Windows Server 2022, the OS takes care of that. This has an adverse effect reported in #56618 which is that using `GetProcessAffinityMask()` API in some edge cases seems buggy now. That API is used to detect if an affinity mask was set, and adjust accordingly the available threads for a ThreadPool.

With this patch, on one hand, we let the OS dispatch threads on all 'processor groups', but only for Windows 11 &amp; Windows Server 2022 and after. We retain the old behavior for older OS versions. On the other hand, a workaround was added to mitigate the `GetProcessAffinityMask()` issue described above (see Threading.inc, L226).

Differential Revision: https://reviews.llvm.org/D138747
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before Windows 11 and Windows Server 2022, only one 'processor group' is assigned by default to a starting process, then the program is responsible for dispatching its own threads on more 'processor groups'. That is what 8404aeb56a73ab24f9b295111de3b37a37f0b841 was doing, allowing LLVM tools to automatically use all hardware threads in the machine.

After Windows 11 and Windows Server 2022, the OS takes care of that. This has an adverse effect reported in #56618 which is that using `GetProcessAffinityMask()` API in some edge cases seems buggy now. That API is used to detect if an affinity mask was set, and adjust accordingly the available threads for a ThreadPool.

With this patch, on one hand, we let the OS dispatch threads on all 'processor groups', but only for Windows 11 &amp; Windows Server 2022 and after. We retain the old behavior for older OS versions. On the other hand, a workaround was added to mitigate the `GetProcessAffinityMask()` issue described above (see Threading.inc, L226).

Differential Revision: https://reviews.llvm.org/D138747
</pre>
</div>
</content>
</entry>
<entry>
<title>[Support] llvm::Optional =&gt; std::optional</title>
<updated>2022-12-16T08:49:10+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2022-12-16T08:49:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b1df3a2c0b6a42570042934cb79ca0e4359f863b'/>
<id>b1df3a2c0b6a42570042934cb79ca0e4359f863b</id>
<content type='text'>
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Use std::nullopt instead of None in comments (NFC)</title>
<updated>2022-12-07T06:45:17+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2022-12-07T06:45:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1f421b6d7e4dde37be9ca490175ca4725add762b'/>
<id>1f421b6d7e4dde37be9ca490175ca4725add762b</id>
<content type='text'>
This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Use std::nullopt instead of llvm::None (NFC)</title>
<updated>2022-12-06T07:50:04+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2022-12-06T07:50:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1ea9dd32709f9b5def5e1c9e83b0a5cdbb134fb2'/>
<id>1ea9dd32709f9b5def5e1c9e83b0a5cdbb134fb2</id>
<content type='text'>
This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</pre>
</div>
</content>
</entry>
<entry>
<title>Threading: Convert Optional to std::optional</title>
<updated>2022-12-01T23:57:17+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2022-12-01T22:36:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7f5d0aa5274e18af0d3a9be92fb9f677c9fe6dc4'/>
<id>7f5d0aa5274e18af0d3a9be92fb9f677c9fe6dc4</id>
<content type='text'>
dthorn: Relanding after fix-forward.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dthorn: Relanding after fix-forward.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Threading: Convert Optional to std::optional"</title>
<updated>2022-12-01T23:42:25+00:00</updated>
<author>
<name>Daniel Thornburgh</name>
<email>dthorn@google.com</email>
</author>
<published>2022-12-01T23:42:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8f0aa9df11195ef435717b24401fe76be06cd69f'/>
<id>8f0aa9df11195ef435717b24401fe76be06cd69f</id>
<content type='text'>
This reverts commit 5e50b8089aee249d77542ea858d956568ec6581f.

This commit breaks the build for BOLT:
  bolt/lib/Profile/DataAggregator.cpp:264:66: error: no viable
  conversion from 'Optional&lt;StringRef&gt;[3]' to
  'ArrayRef&lt;std::optional&lt;StringRef&gt;&gt;'
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 5e50b8089aee249d77542ea858d956568ec6581f.

This commit breaks the build for BOLT:
  bolt/lib/Profile/DataAggregator.cpp:264:66: error: no viable
  conversion from 'Optional&lt;StringRef&gt;[3]' to
  'ArrayRef&lt;std::optional&lt;StringRef&gt;&gt;'
</pre>
</div>
</content>
</entry>
<entry>
<title>Threading: Convert Optional to std::optional</title>
<updated>2022-12-01T22:36:05+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2022-12-01T22:36:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5e50b8089aee249d77542ea858d956568ec6581f'/>
<id>5e50b8089aee249d77542ea858d956568ec6581f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Support] Move getHostNumPhysicalCores to Threading.h</title>
<updated>2022-11-29T13:14:13+00:00</updated>
<author>
<name>Archibald Elliott</name>
<email>archibald.elliott@arm.com</email>
</author>
<published>2022-11-25T16:25:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3c97f6cab92fb3511d72996ac7ca8a8b459ebc88'/>
<id>3c97f6cab92fb3511d72996ac7ca8a8b459ebc88</id>
<content type='text'>
This change is focussed on simplifying `Support/Host.h` to only do
target detection. In this case, this function is close in usage to
existing functions in `Support/Threading.h`, so I moved it into there.
The function is also renamed to `llvm::get_physical_cores()` to match
the style of threading's functions.

The big change here is that now if you have threading disabled,
`llvm::get_physical_cores()` will return -1, as if it had not been able
to work out the right info. This is due to how Threading.cpp includes
OS-specific code/headers. This seems ok, as if threading is disabled,
LLVM should not need to know the number of physical cores.

Differential Revision: https://reviews.llvm.org/D137836
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change is focussed on simplifying `Support/Host.h` to only do
target detection. In this case, this function is close in usage to
existing functions in `Support/Threading.h`, so I moved it into there.
The function is also renamed to `llvm::get_physical_cores()` to match
the style of threading's functions.

The big change here is that now if you have threading disabled,
`llvm::get_physical_cores()` will return -1, as if it had not been able
to work out the right info. This is due to how Threading.cpp includes
OS-specific code/headers. This seems ok, as if threading is disabled,
LLVM should not need to know the number of physical cores.

Differential Revision: https://reviews.llvm.org/D137836
</pre>
</div>
</content>
</entry>
</feed>
