Skip to content

[OpenMP] Remove internal linkage from __kmp_wait template (NFC) - #207983

Merged
vgvassilev merged 1 commit into
llvm:mainfrom
flash1729:wunused-template-openmp-kmp
Jul 7, 2026
Merged

vgvassilev merged 1 commit into
llvm:mainfrom
flash1729:wunused-template-openmp-kmp

Conversation

@flash1729

Copy link
Copy Markdown
Member

__kmp_wait in kmp_dispatch.h is a static function template in a header, so any TU that includes it without instantiating it trips -Wunused-template (kmp_runtime.cpp, kmp_affinity.cpp, kmp_global.cpp, kmp_settings.cpp). It is used by kmp_dispatch.cpp and kmp_dispatch_hier.h. Drop static, which the comment above it already suggests.

Part of #202945

__kmp_wait in kmp_dispatch.h is a static function template in a header, so
any TU that includes it without instantiating it trips -Wunused-template
(kmp_runtime.cpp, kmp_affinity.cpp, kmp_global.cpp, kmp_settings.cpp). It is
used by kmp_dispatch.cpp and kmp_dispatch_hier.h. Drop static, which the
comment above it already suggests.

Part of llvm#202945.
@llvmorg-github-actions llvmorg-github-actions Bot added the openmp:libomp OpenMP host runtime label Jul 7, 2026
@flash1729

Copy link
Copy Markdown
Member Author

Ping for review @mjklemm @TerryLWilmarth @vgvassilev @erichkeane
after including -Wunused-template OpenMP builds were failing, landing this will make sure that does not happen
Please check #207957 for reference

@vgvassilev vgvassilev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

@mjklemm mjklemm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vgvassilev
vgvassilev merged commit 29f1a71 into llvm:main Jul 7, 2026
11 checks passed
aobolensk pushed a commit to aobolensk/llvm-project that referenced this pull request Jul 8, 2026
…#207983)

__kmp_wait in kmp_dispatch.h is a static function template in a header,
so any TU that includes it without instantiating it trips
-Wunused-template (kmp_runtime.cpp, kmp_affinity.cpp, kmp_global.cpp,
kmp_settings.cpp). It is used by kmp_dispatch.cpp and
kmp_dispatch_hier.h. Drop static, which the comment above it already
suggests.

Part of llvm#202945
vgvassilev pushed a commit that referenced this pull request Jul 8, 2026
Reland of #206123, which was reverted in #207848.

What has changed since:

- flang-rt occurrences are fixed in #207979 
- openmp had one more occurrence which is fixed in #207983 
- The remaining -Wunused-template hits anywhere in CI logs are the tsan
Go runtime warnings, which are warnings only (buildgo.sh does not use
-Werror on Linux)

Marked as draft until #207979  and #207983  land.

Closes #202945
gandhi56 pushed a commit that referenced this pull request Jul 9, 2026
)

__kmp_wait in kmp_dispatch.h is a static function template in a header,
so any TU that includes it without instantiating it trips
-Wunused-template (kmp_runtime.cpp, kmp_affinity.cpp, kmp_global.cpp,
kmp_settings.cpp). It is used by kmp_dispatch.cpp and
kmp_dispatch_hier.h. Drop static, which the comment above it already
suggests.

Part of #202945
gandhi56 pushed a commit that referenced this pull request Jul 9, 2026
Reland of #206123, which was reverted in #207848.

What has changed since:

- flang-rt occurrences are fixed in #207979 
- openmp had one more occurrence which is fixed in #207983 
- The remaining -Wunused-template hits anywhere in CI logs are the tsan
Go runtime warnings, which are warnings only (buildgo.sh does not use
-Werror on Linux)

Marked as draft until #207979  and #207983  land.

Closes #202945
@flash1729
flash1729 deleted the wunused-template-openmp-kmp branch August 7, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

openmp:libomp OpenMP host runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants