Go to file
Jonathan Peyton 65ebfeecf8 [OpenMP] Fix thread_limits to work properly for teams construct
The thread-limit-var and omp_get_thread_limit API was not perfectly handled for
teams construct. Now, when modified by thread_limit clause, omp_get_thread_limit
reports the correct value. In addition, the value is restored when leaving the
teams construct to what it was in the encountering context.

This is done partly by creating the notion of a Contention Group root (CG root)
that keeps track of the thread at the root of each separate CG, the
thread-limit-var associated with the CG, and associated counter of active
threads within the contention group.

thread-limits are passed from master to worker threads via an entry in the ICV
data structure. When a "contention group switch" occurs, a new CG root record is
made and passed from master to worker. A thread could potentially have several
CG root records if it encounters multiple nested teams constructs (but at the
moment the spec doesn't allow for nested teams, so the most one could have
currently is 2). The master of the teams masters gets the thread-limit clause
value stored to its local ICV structure, and the other teams masters copy it
from the master. The thread-limit is set from that ICV copy and restored to the
ICV copy when entering and leaving the teams construct.

This change also fixes a bug when the top-level teams construct team gets
reused, and OMP_DYNAMIC was true, which can cause the expected size of this team
to be smaller than what was actually allocated. The fix updates the size of the
team after its threads were reserved.

Patch by Terry Wilmarth

Differential Revision: https://reviews.llvm.org/D56804

llvm-svn: 353747
2019-02-11 21:04:23 +00:00
clang Fix a few tests that were missing ':' on CHECK lines and weren't testing anything. 2019-02-11 20:33:22 +00:00
clang-tools-extra Revamp the "[clangd] Format tweak's replacements" 2019-02-11 15:18:11 +00:00
compiler-rt [NFC] Re-enable XFAILed fuzzer test on iOS 2019-02-11 19:33:01 +00:00
debuginfo-tests Set config.lit_tools_dir, which is needed by lit.llvm.initialize. 2018-11-06 21:54:27 +00:00
libclc Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
libcxx [libcxx] Preserve order, avoid duplicates when merging static archives 2019-02-11 08:48:47 +00:00
libcxxabi [CMake] Support compiler-rt builtins library in tests 2019-02-05 19:50:47 +00:00
libunwind [CMake] Support compiler-rt builtins library in tests 2019-02-05 19:50:47 +00:00
lld [LLD][ELF] - Update test case after yaml2obj change. NFCI. 2019-02-09 11:34:59 +00:00
lldb Update SymbolVendorMacOSX for new GetUUID interface 2019-02-11 17:19:26 +00:00
llgo Adjust documentation for git migration. 2019-01-29 16:37:27 +00:00
llvm [globalisel] Correct string emitted by GISelChangeObserver::erasingInstr() 2019-02-11 20:45:19 +00:00
openmp [OpenMP] Fix thread_limits to work properly for teams construct 2019-02-11 21:04:23 +00:00
parallel-libs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
polly [opaque pointer types] Update calls to CreateCall to pass the function 2019-02-08 19:30:46 +00:00
pstl [NFC] Fix typo in PSTL test 2019-02-11 17:45:15 +00:00
.arcconfig Update monorepo .arcconfig with new project callsign. 2019-01-31 14:34:59 +00:00
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
README.md

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.