Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BOLT #84

Merged
merged 39 commits into from
Oct 28, 2020
Merged

Update BOLT #84

merged 39 commits into from
Oct 28, 2020

Conversation

shintaro-iwasaki
Copy link
Collaborator

To f2400f024d323bc9000a4c126f2008a8b58fb4a0

grokos and others added 30 commits October 7, 2020 13:30
Libomptarget patch adding runtime support for "declare mapper".
Patch co-developed by Lingda Li and George Rokos.

Differential revision: https://reviews.llvm.org/D68100

cherry-pick: 140ab574a1c81e0878b3238520302509457242d0
llvm/llvm-project@140ab57
Add releasing->acquire edges for child task->taskwait and
child task->end of taskgroup.

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

cherry-pick: ffd8f009311965cfaa75594f98da351350ea0df4
llvm/llvm-project@ffd8f00
Differential Revision: https://reviews.llvm.org/D83857

cherry-pick: 515bc8c1554f03515565878ea3d35cffdc6fd195
llvm/llvm-project@515bc8c
Add barrier/region notification for parallel inside teams construct
when number of teams is 1, as VTune only shows outer level regions for
simplicity.

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

cherry-pick: 62d88a1c79f58b7c9a8f9d21f24bb22802d3646b
llvm/llvm-project@62d88a1
hwloc documentation guarantees the only object that is always present
in the topology is PU. We can check the presence of other objects
in the topology, just in case.

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

cherry-pick: 86fb2db49b33aa4759d351b30ea1f6ebbe252c60
llvm/llvm-project@86fb2db
Add check of negative gtid before indexing __kmp_threads.
This makes static analyzers happier.
This is the first part of the patch split in two parts.

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

cherry-pick: 787eb0c637b26ce88e91403584b016a42ab5d59c
llvm/llvm-project@787eb0c
Add check of frm to prevent array out-of-bound access;
add check of new_nproc to prevent access of unallocated hot_teams array;
add check of location info pointer to prevent NULL dereference;
add check of d_tn pointer to prevent NULL dereference in release build.
These checks make static analyzers happier.

This is second part of the patch from https://reviews.llvm.org/D84062.

cherry-pick: 917f8421591d2cc53c48ebd17d88b0dd3255aa2c
llvm/llvm-project@917f842
cherry-pick: 5a8779169ebc6a5bb839b46c6201e9217b7e3561
llvm/llvm-project@5a87791
cherry-pick: 617787ea77a22f752ba1fcd4ac7cb9a62a710756
llvm/llvm-project@617787e
Following tests were disabled for clang-11 after upgrading to
version 5.0 in D82963:

1. openmp/runtime/test/env/kmp_set_dispatch_buf.c
2. openmp/runtime/test/worksharing/for/kmp_set_dispatch_buf.c

They are also failing for clang-12. Thus this temporary disabling
until they are fixed.

Reviewed By: ABataev

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

cherry-pick: 741e55aeed758c747d91e99e7164afa2fb5d9c10
llvm/llvm-project@741e55a
This implements OpenMP runtime support for the OpenMP TR8 `present`
map type modifier.  The previous patch in this series implements Clang
front end support.  See that patch summary for behaviors that are not
yet supported.

Reviewed By: grokos, jdoerfert

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

cherry-pick: 45b8f7ec35ef653bafdf48034857222517c17781
llvm/llvm-project@45b8f7e
… (2/2)"

This reverts commit 45b8f7ec35ef653bafdf48034857222517c17781.

It attempts to use debug macros `DPxMOD` and `DPxPTR` in release
builds.  Will fix and reapply later.

cherry-pick: fc247c8f3c61c327f58ba361ab01ce72641bbdcb
llvm/llvm-project@fc247c8
This implements OpenMP runtime support for the OpenMP TR8 `present`
map type modifier.  The previous patch in this series implements Clang
front end support.  See that patch summary for behaviors that are not
yet supported.

Reviewed By: grokos, jdoerfert

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

cherry-pick: 708752b2f6c55eec85accf4d67b9e9da5a08ddf1
llvm/llvm-project@708752b
This upgrade should be friction-less because we've already been ensuring
that CMake >= 3.13.4 is used.

This is part of the effort discussed on llvm-dev here:

  http://lists.llvm.org/pipermail/llvm-dev/2020-April/140578.html

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

cherry-pick: afa1afd4108d973e059e5f5ad68cf01efe7985da
llvm/llvm-project@afa1afd
Summary:
In the function `target`, memory deallocation and `target_data_end` is called
immediately returning from launching kernel. This might cause a race condition
that the corresponding memory is still being used by the kernel and a potential
issue that when the kernel starts to execute, its required data have already
been deallocated, especially when multiple kernels running concurrently. Since
nevertheless, we will block the thread issuing the target offloading at the end
of the target, we just move the synchronization ahead a little bit to make sure
the correctness.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: yaxunl, guansong, sstefan1, openmp-commits

Tags: #openmp

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

cherry-pick: 9b2832c0897c1d39846eee0ad84bf787f05d2d4b
llvm/llvm-project@9b2832c
This reverts commit 9b2832c0897c1d39846eee0ad84bf787f05d2d4b.

cherry-pick: c0185dc7df86c763837916771d02c4a5e1b44dbf
llvm/llvm-project@c0185dc
Additionally fix the copy if enabled on multi-config targets.

Summary:
This changes the copy command for libomp.so to use the output of the target as
the source of the copy, rather than trying to find it based on
${LIBOMP_LIBRARY_DIR}, which appears to be incorrect in multi-config generator
builds.

Reviewers: jdoerfert

Subscribers: mgorny, yaxunl, guansong, sstefan1, openmp-commits

Tags: #openmp

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

cherry-pick: bb099c87abbfb78b2bdda395ea3f04d2a77c3082
llvm/llvm-project@bb099c8
See PR46515 for the rational but generally, we want to *really* abort
not gracefully shut down.

Reviewed By: grokos, ABataev

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

cherry-pick: 9c87466c3960145eb5baa2881d4239de1dcfbc6f
llvm/llvm-project@9c87466
Per RFC http://lists.llvm.org/pipermail/llvm-dev/2020-April/141295.html
no one is making use of QPX/A2Q/BGQ/BGP CNK anymore.

This patch remove the support of QPX/A2Q in llvm, BGQ/BGP in clang,
CNK support in openmp/polly.

Reviewed By: hfinkel

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

cherry-pick: adffce71538e219aab4eeb024819baa7687262ff
llvm/llvm-project@adffce7
Summary:
1. Add DeviceTy::data_alloc, DeviceTy::data_delete, DeviceTy::data_alloc, DeviceTy::synchronize pass-through functions. Avoid directly accessing Device.RTL
2. Fix the type of the first argument of synchronize_ty in rth.h, device id is int32_t which is consistent with other functions.

Reviewers: tianshilei1992, jdoerfert

Reviewed By: tianshilei1992

Subscribers: yaxunl, guansong, sstefan1, openmp-commits

Tags: #openmp

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

cherry-pick: 932316660179c1273e365d9dbbe648478bc5c4f1
llvm/llvm-project@9323166
This reverts commit adffce71538e219aab4eeb024819baa7687262ff.

This is breaking test-suite, revert while investigation.

cherry-pick: bf544fa1c3cb80f24d85e84559fb11193846259f
llvm/llvm-project@bf544fa
Also add $BUILD/lib to the LIBRARY_PATH to fix
https://bugs.llvm.org/show_bug.cgi?id=46836.

Reviewed By: JonChesterfield

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

cherry-pick: e2f5444c9ce2e0558a69fb32bd001017244eeebc
llvm/llvm-project@e2f5444
On runtime failures, D83963 causes the runtime to abort instead of
merely exiting with a non-zero value, but many tests in the
libomptarget test suite still expect the former behavior.  This patch
updates the test suite and was discussed in post-commit comments on
D83963 and D84557.

cherry-pick: 9b4826d18b5fba5fe638e1045c9c47d3fe8da8c8
llvm/llvm-project@9b4826d
This reverts commit bf544fa1c3cb80f24d85e84559fb11193846259f.

Fixed the typo in PPCInstrInfo.cpp.

cherry-pick: d28f86723f37b2329428dfbcf847d3261f38dcc8
llvm/llvm-project@d28f867
This patch implements OpenMP runtime support for the OpenMP TR8
`present` motion modifier for `omp target update` directives.  The
previous patch in this series implements Clang front end support.

Reviewed By: grokos

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

cherry-pick: 2cb926a447d22166dac0d6e6dceaf5b3616ef6a1
llvm/llvm-project@2cb926a
…conform with LLVM code standard

This patch only touched variables and functions in `target`.

Reviewed By: ye-luo

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

cherry-pick: 3ce69d4d50a24394eff15f92e3f4a609acc963e7
llvm/llvm-project@3ce69d4
…2/2)"

This reverts commit 2cb926a447d22166dac0d6e6dceaf5b3616ef6a1.

It depends on 3c3faae497046be706df29e16c9fbccb7e1fce09, which is being
reverted.

cherry-pick: 65564e5eaf143cb3c43907cc546d76e2b20e59f3
llvm/llvm-project@65564e5
Reviewed By: ye-luo

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

cherry-pick: 30440924d48cdcbdef1dd7b2791171d821a859ae
llvm/llvm-project@3044092
jdenny-ornl and others added 8 commits October 7, 2020 13:30
This patch implements OpenMP runtime support for the OpenMP TR8
`present` motion modifier for `omp target update` directives.  The
previous patch in this series implements Clang front end support.

Reviewed By: grokos

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

cherry-pick: cee52dd02672ecff33d9bd8300aa09a91853a149
llvm/llvm-project@cee52dd
… in target region.

Need to map the base pointer for all directives, not only target
data-based ones.
The base pointer is mapped for array sections, array subscript, array
shaping and other array-like constructs with the base pointer. Also,
codegen for use_device_ptr clause was modified to correctly handle
mapping combination of array like constructs + use_device_ptr clause.
The data for use_device_ptr clause is emitted as the last records in the
data mapping array.
It applies only for global pointers.

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

cherry-pick: 142d0d3ed8e07aca2476bc4ecc1a12d15577a84a
llvm/llvm-project@142d0d3
…accessed in target region."

This reverts commit 142d0d3ed8e07aca2476bc4ecc1a12d15577a84a to
investigate undefined behavior revealed by buildbots.

cherry-pick: b69357c2f4f2aa0c4999d6827a40fe748641fdb1
llvm/llvm-project@b69357c
… in target region.

Need to map the base pointer for all directives, not only target
data-based ones.
The base pointer is mapped for array sections, array subscript, array
shaping and other array-like constructs with the base pointer. Also,
codegen for use_device_ptr clause was modified to correctly handle
mapping combination of array like constructs + use_device_ptr clause.
The data for use_device_ptr clause is emitted as the last records in the
data mapping array.

Reviewed By: ye-luo

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

cherry-pick: 622e46156d9a91206c877a604d069bb3e2dbf294
llvm/llvm-project@622e461
Refactored the function `target` to make preparation for fixing the
issue of ahead-of-time device memory deallocation.

Reviewed By: ye-luo

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

cherry-pick: 8218eee269c382472b9809cb3cce7a98eed7a31b
llvm/llvm-project@8218eee
Refactored the function `targetDataEnd` to make preparation of fixing
the issue of ahead-of-time target memory deallocation. This patch only
renamed `targetDataEnd` related variables and functions to conform
with LLVM code standard.

Reviewed By: ye-luo

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

cherry-pick: 0f1016562648e0c5ab0618823d5d6b7280ca86ba
llvm/llvm-project@0f10165
This is to address the issue reported at:
https://bugs.llvm.org/show_bug.cgi?id=46863

Since weak is meaningless for a shared library interface function, this patch
disables the attribute, when the OpenMP library is built as shared library.

ompt_start_tool is not an interface function, but a internally called function
possibly implemented by an OMPT tool.
This function needs to be weak if possible to allow overwriting ompt_start_tool
with a function implementation built into the application.

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

cherry-pick: 03116a9f8c2fc98577e153083aaf9b6a701ab8f9
llvm/llvm-project@03116a9
…led when they're being used

This patch fixed the issue that target memory might be deallocated when
they're still being used or before they're used.

Reviewed By: ye-luo

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

cherry-pick: f2400f024d323bc9000a4c126f2008a8b58fb4a0
llvm/llvm-project@f2400f0
@shintaro-iwasaki
Copy link
Collaborator Author

test:bolt/all

@shintaro-iwasaki
Copy link
Collaborator Author

The test results show that the coverage of BOLT is the same as that of the official LLVM OpenMP (at the point of f2400f024d323bc9000a4c126f2008a8b58fb4a0): https://jenkins-pmrs.cels.anl.gov/job/bolt-llvmproj-review-centos/2/.

Let's merge this PR.

@shintaro-iwasaki shintaro-iwasaki merged commit bab54bf into pmodels:main Oct 28, 2020
@shintaro-iwasaki shintaro-iwasaki deleted the bolt-a6f6c9 branch October 30, 2020 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet