aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/MathExtrasTest.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <Krzysztof.Parzyszek@amd.com>2024-04-22 14:41:11 -0500
committerGitHub <noreply@github.com>2024-04-22 14:41:11 -0500
commit40137ff0d81be80e4900c17c57b1f66c53ddf2f9 (patch)
treec8369d3eb71fc1f9c83a199a3c956a4830e6ddcd /llvm/unittests/Support/MathExtrasTest.cpp
parent89c95effe82c09b9a42408f4823409331f8fa266 (diff)
downloadllvm-40137ff0d81be80e4900c17c57b1f66c53ddf2f9.zip
llvm-40137ff0d81be80e4900c17c57b1f66c53ddf2f9.tar.gz
llvm-40137ff0d81be80e4900c17c57b1f66c53ddf2f9.tar.bz2
[Frontend][OpenMP] Refactor getLeafConstructs, add getCompoundConstruct (#87247)
Emit a special leaf construct table in DirectiveEmitter.cpp, which will allow both decomposition of a construct into leafs, and composition of constituent constructs into a single compound construct (if possible). The function `getLeafConstructs` is no longer auto-generated, but implemented in OMP.cpp. The table contains a row for each directive, and each row has the following format `dir_id, num_leafs, leaf1, leaf2, ..., leafN, -1, ...` The rows are sorted lexicographically with respect to the leaf constructs. This allows a binary search for the row corresponding to the given list of leafs. There is an auxiliary table that for each directive contains the index of the row corresponding to that directive. Looking up leaf constructs for a directive `dir_id` is of constant time, and and consists of two lookups: `LeafTable[Auxiliary[dir_id]]`. Finding a compound directive given the set of leafs is of time O(logn), and is roughly represented by `row = binary_search(LeafTable); return row[0]`. The functions `getLeafConstructs` and `getCompoundConstruct` use these lookup methods internally.
Diffstat (limited to 'llvm/unittests/Support/MathExtrasTest.cpp')
0 files changed, 0 insertions, 0 deletions