[llvm] Windows: use EcoQoS for ThreadPriority::Background (PR #148797)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 23 09:53:52 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions inc -- llvm/lib/Support/Windows/Threading.inc
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Support/Windows/Threading.inc b/llvm/lib/Support/Windows/Threading.inc
index 571e0960a..a405ebdf9 100644
--- a/llvm/lib/Support/Windows/Threading.inc
+++ b/llvm/lib/Support/Windows/Threading.inc
@@ -108,8 +108,8 @@ void llvm::get_thread_name(SmallVectorImpl<char> &Name) {
SetThreadPriorityResult llvm::set_thread_priority(ThreadPriority Priority) {
- // SetThreadInformation is only available on Windows 8 and later. Since we still
- // support compilation on Windows 7, we load the function dynamically.
+ // SetThreadInformation is only available on Windows 8 and later. Since we
+ // still support compilation on Windows 7, we load the function dynamically.
typedef BOOL(WINAPI * SetThreadInformation_t)(
HANDLE hThread, THREAD_INFORMATION_CLASS ThreadInformationClass,
_In_reads_bytes_(ThreadInformationSize) PVOID ThreadInformation,
@@ -132,8 +132,9 @@ SetThreadPriorityResult llvm::set_thread_priority(ThreadPriority Priority) {
// efficent cores at the most efficient cpu frequency):
// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setthreadinformation
// https://learn.microsoft.com/en-us/windows/win32/procthread/quality-of-service
- setThreadInformation(Priority == ThreadPriority::Background ? THREAD_POWER_THROTTLING_EXECUTION_SPEED
- : 0);
+ setThreadInformation(Priority == ThreadPriority::Background
+ ? THREAD_POWER_THROTTLING_EXECUTION_SPEED
+ : 0);
}
// https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-setthreadpriority
``````````
</details>
https://github.com/llvm/llvm-project/pull/148797
More information about the llvm-commits
mailing list