[llvm-branch-commits] [llvm] fdbcec9 - [llvm-debuginfo-analyzer] LLVM 16.0.0-rc1 Failing test on osx-64.

2023-02-14 Thread Tobias Hieta via llvm-branch-commits

Author: Carlos Alberto Enciso
Date: 2023-02-14T08:59:50+01:00
New Revision: fdbcec90388a159eb8e969177dbebca57f4a854d

URL: 
https://github.com/llvm/llvm-project/commit/fdbcec90388a159eb8e969177dbebca57f4a854d
DIFF: 
https://github.com/llvm/llvm-project/commit/fdbcec90388a159eb8e969177dbebca57f4a854d.diff

LOG: [llvm-debuginfo-analyzer] LLVM 16.0.0-rc1 Failing test on osx-64.

As describe in

https://github.com/llvm/llvm-project/issues/60363

the following DebugInfo LogicalView Tests unit tests failed:

- ELFReader
- SelectElements

The tests fail only on the OSX-64 platform with the CMake options:

-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON

Using the same options on a Linux platform all the tests pass:
- https://lab.llvm.org/buildbot/#/builders/196
- llvm-x86_64-debian-dylib

Basically it is a dynamic library initialization affecting a static
instance for the string pool (LVStringPool).

That string pool instance is accessed by all the logical elements
to store/retrieve any associated string during the creation of the
logical view.

For a logical view comparison, both logical readers (Reference and
Target) use retrieved indexes when comparing their strings.

Moved the static instance to LVSupport module (unnamed namespace).

Reviewed By: jmorse

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

(cherry picked from commit 92716a42a6aa584fb009031a9f703b5dac310043)

Added: 


Modified: 
llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h
llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h
llvm/lib/DebugInfo/LogicalView/Core/LVSupport.cpp

Removed: 




diff  --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h 
b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h
index 2603c4542e8dc..68dfefba3b3cd 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h
@@ -15,7 +15,6 @@
 #define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVELEMENT_H
 
 #include "llvm/DebugInfo/LogicalView/Core/LVObject.h"
-#include "llvm/DebugInfo/LogicalView/Core/LVStringPool.h"
 #include "llvm/Support/Casting.h"
 #include 
 #include 

diff  --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h 
b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
index 671ccf5d0e152..4c596b5b1dde7 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
@@ -71,11 +71,6 @@ class LVStringPool {
 return (Index >= Entries.size()) ? StringRef() : Entries[Index]->getKey();
   }
 
-  static LVStringPool &getInstance() {
-static LVStringPool Instance;
-return Instance;
-  }
-
   void print(raw_ostream &OS) const {
 if (!Entries.empty()) {
   OS << "\nString Pool:\n";
@@ -90,8 +85,6 @@ class LVStringPool {
 #endif
 };
 
-inline LVStringPool &getStringPool() { return LVStringPool::getInstance(); }
-
 } // namespace logicalview
 } // end namespace llvm
 

diff  --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h 
b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h
index bff1499c1a60f..a2274ec1a62f7 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/SmallBitVector.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/Twine.h"
+#include "llvm/DebugInfo/LogicalView/Core/LVStringPool.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/Path.h"
@@ -27,6 +28,9 @@
 namespace llvm {
 namespace logicalview {
 
+// Returns the unique string pool instance.
+LVStringPool &getStringPool();
+
 template 
 using TypeIsValid = std::bool_constant::value>;
 

diff  --git a/llvm/lib/DebugInfo/LogicalView/Core/LVSupport.cpp 
b/llvm/lib/DebugInfo/LogicalView/Core/LVSupport.cpp
index 9fa1f28eb0895..6d55b755ed46c 100644
--- a/llvm/lib/DebugInfo/LogicalView/Core/LVSupport.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Core/LVSupport.cpp
@@ -20,6 +20,12 @@ using namespace llvm::logicalview;
 
 #define DEBUG_TYPE "Support"
 
+namespace {
+// Unique string pool instance used by all logical readers.
+LVStringPool StringPool;
+} // namespace
+LVStringPool &llvm::logicalview::getStringPool() { return StringPool; }
+
 // Perform the following transformations to the given 'Path':
 // - all characters to lowercase.
 // - '\\' into '/' (Platform independent).



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] ad4fda8 - [Release] Produce bolt tarball

2023-02-14 Thread Tobias Hieta via llvm-branch-commits

Author: Peter Jung
Date: 2023-02-14T09:00:04+01:00
New Revision: ad4fda80acb2771e82a62e32c02ddab9f555f3d9

URL: 
https://github.com/llvm/llvm-project/commit/ad4fda80acb2771e82a62e32c02ddab9f555f3d9
DIFF: 
https://github.com/llvm/llvm-project/commit/ad4fda80acb2771e82a62e32c02ddab9f555f3d9.diff

LOG: [Release] Produce bolt tarball

Source tarball's are used from some distribution to build the project

Reviewed By: Amir

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

(cherry picked from commit b673135bb833a54b16c32e2073d2d7b83c90de66)

Added: 


Modified: 
llvm/utils/release/export.sh

Removed: 




diff  --git a/llvm/utils/release/export.sh b/llvm/utils/release/export.sh
index 8fd942f6ef4b1..807731679c96b 100755
--- a/llvm/utils/release/export.sh
+++ b/llvm/utils/release/export.sh
@@ -13,7 +13,7 @@
 
 set -e
 
-projects="llvm clang cmake compiler-rt libcxx libcxxabi libclc 
clang-tools-extra polly lldb lld openmp libunwind mlir flang third-party"
+projects="llvm bolt clang cmake compiler-rt libcxx libcxxabi libclc 
clang-tools-extra polly lldb lld openmp libunwind mlir flang third-party"
 
 release=""
 rc=""



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] 564b29c - [libc++] fix `shared_ptr`'s incorrect constraints

2023-02-14 Thread Tobias Hieta via llvm-branch-commits

Author: Hui
Date: 2023-02-14T09:00:14+01:00
New Revision: 564b29ce936222ae3dcf7b5e5ceb1658ee3abc74

URL: 
https://github.com/llvm/llvm-project/commit/564b29ce936222ae3dcf7b5e5ceb1658ee3abc74
DIFF: 
https://github.com/llvm/llvm-project/commit/564b29ce936222ae3dcf7b5e5ceb1658ee3abc74.diff

LOG: [libc++] fix `shared_ptr`'s incorrect constraints

Fix several bugs:
1. https://llvm.org/PR60258
   The conversion constructors' constraint `__compatible_with` incorrectly 
allow array types conversion to scalar types
2. https://llvm.org/PR53368
   The constructor that takes `unique_ptr` are not suffiently constrained.
3. The constructors that take raw pointers incorretly use `__compatible_with`. 
They have different constraints

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

(cherry picked from commit a38a4654ce4b1d2ae8a03797d2e520e415150492)

Added: 

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_helper.h

Modified: 
libcxx/include/__memory/shared_ptr.h

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer.pass.cpp

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y.pass.cpp

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y_rv.pass.cpp

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/weak_ptr.pass.cpp

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer.pass.cpp

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter.pass.cpp

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer_deleter_allocator.pass.cpp

Removed: 




diff  --git a/libcxx/include/__memory/shared_ptr.h 
b/libcxx/include/__memory/shared_ptr.h
index 6bb9ca968dfad..99bfd54094867 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -367,13 +367,57 @@ class _LIBCPP_TEMPLATE_VIS 
allocator<__shared_ptr_dummy_rebind_allocator_type>
 
 template class _LIBCPP_TEMPLATE_VIS enable_shared_from_this;
 
-template
+// http://eel.is/c++draft/util.sharedptr#util.smartptr.shared.general-6
+// A pointer type Y* is said to be compatible with a pointer type T*
+// when either Y* is convertible to T* or Y is U[N] and T is cv U[].
+#if _LIBCPP_STD_VER >= 17
+template 
+struct __bounded_convertible_to_unbounded : false_type {};
+
+template 
+struct __bounded_convertible_to_unbounded<_Up[_Np], _Tp>
+: is_same<__remove_cv_t<_Tp>, _Up[]> {};
+
+template 
 struct __compatible_with
-#if _LIBCPP_STD_VER > 14
-: is_convertible*, remove_extent_t<_Up>*> {};
+: _Or<
+is_convertible<_Yp*, _Tp*>,
+__bounded_convertible_to_unbounded<_Yp, _Tp>
+> {};
 #else
-: is_convertible<_Tp*, _Up*> {};
-#endif // _LIBCPP_STD_VER > 14
+template 
+struct __compatible_with
+: is_convertible<_Yp*, _Tp*> {};
+#endif // _LIBCPP_STD_VER >= 17
+
+// Constructors that take raw pointers have a 
diff erent set of "compatible" constraints
+// http://eel.is/c++draft/util.sharedptr#util.smartptr.shared.const-9.1
+// - If T is an array type, then either T is U[N] and Y(*)[N] is convertible 
to T*,
+//   or T is U[] and Y(*)[] is convertible to T*.
+// - If T is not an array type, then Y* is convertible to T*.
+#if _LIBCPP_STD_VER >= 17
+template 
+struct __raw_pointer_compatible_with : _And<
+_Not>,
+is_convertible<_Yp*, _Tp*>
+> {};
+
+template 
+struct __raw_pointer_compatible_with<_Yp, _Up[_Np], __enable_if_t<
+is_convertible<_Yp(*)[_Np], _Up(*)[_Np]>::value> >
+: true_type {};
+
+template 
+struct __raw_pointer_compatible_with<_Yp, _Up[], __enable_if_t<
+is_convertible<_Yp(*)[], _Up(*)[]>::value> >
+: true_type {};
+
+#else
+template 
+struct __raw_pointer_compatible_with
+: is_convertible<_Yp*, _Tp*> {};
+#endif // _LIBCPP_STD_VER >= 17
+
 
 template 
 struct __is_deletable : false_type { };
@@ -395,12 +439,12 @@ static false_type __well_formed_deleter_test(...);
 template 
 struct __well_formed_deleter : decltype(std::__well_formed_deleter_test<_Dp, 
_Pt>(0)) {};
 
-template
+template
 struct __shared_ptr_

[llvm-branch-commits] [libcxx] 8e12c6e - [libc++][NFC] Rename _LIBCPP_NO_RTTI to _LIBCPP_HAS_NO_RTTI

2023-02-14 Thread Tobias Hieta via llvm-branch-commits

Author: Nikolas Klauser
Date: 2023-02-14T09:00:14+01:00
New Revision: 8e12c6e9c47ac25ce11bf0cf75631973a9b49853

URL: 
https://github.com/llvm/llvm-project/commit/8e12c6e9c47ac25ce11bf0cf75631973a9b49853
DIFF: 
https://github.com/llvm/llvm-project/commit/8e12c6e9c47ac25ce11bf0cf75631973a9b49853.diff

LOG: [libc++][NFC] Rename _LIBCPP_NO_RTTI to _LIBCPP_HAS_NO_RTTI

Other macros that disable parts of the library are named 
`_LIBCPP_HAS_NO_WHATEVER`.

Reviewed By: ldionne, Mordante, #libc

Spies: libcxx-commits

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

(cherry picked from commit cf65d275ac048dfb781c7302c6c82c3500184eb1)

Added: 


Modified: 
libcxx/include/__config
libcxx/include/__functional/function.h
libcxx/include/__memory/shared_ptr.h
libcxx/include/any

Removed: 




diff  --git a/libcxx/include/__config b/libcxx/include/__config
index 51b100fa55699..5daa348c79b5f 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -904,7 +904,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
 
 // Try to find out if RTTI is disabled.
 #  if !defined(__cpp_rtti) || __cpp_rtti < 199711L
-#define _LIBCPP_NO_RTTI
+#define _LIBCPP_HAS_NO_RTTI
 #  endif
 
 #  ifndef _LIBCPP_WEAK

diff  --git a/libcxx/include/__functional/function.h 
b/libcxx/include/__functional/function.h
index ca79d334a0280..9f92f6181468f 100644
--- a/libcxx/include/__functional/function.h
+++ b/libcxx/include/__functional/function.h
@@ -268,10 +268,10 @@ class __base<_Rp(_ArgTypes...)>
 virtual void destroy() _NOEXCEPT = 0;
 virtual void destroy_deallocate() _NOEXCEPT = 0;
 virtual _Rp operator()(_ArgTypes&& ...) = 0;
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
 virtual const void* target(const type_info&) const _NOEXCEPT = 0;
 virtual const std::type_info& target_type() const _NOEXCEPT = 0;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
 };
 
 // __func implements __base for a given functor type.
@@ -305,10 +305,10 @@ class __func<_Fp, _Alloc, _Rp(_ArgTypes...)>
 virtual void destroy() _NOEXCEPT;
 virtual void destroy_deallocate() _NOEXCEPT;
 virtual _Rp operator()(_ArgTypes&&... __arg);
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
 virtual const void* target(const type_info&) const _NOEXCEPT;
 virtual const std::type_info& target_type() const _NOEXCEPT;
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
 };
 
 template
@@ -356,7 +356,7 @@ __func<_Fp, _Alloc, 
_Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
 return __f_(_VSTD::forward<_ArgTypes>(__arg)...);
 }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
 
 template
 const void*
@@ -374,7 +374,7 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target_type() const 
_NOEXCEPT
 return typeid(_Fp);
 }
 
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
 
 // __value_func creates a value-type from a __func.
 
@@ -553,7 +553,7 @@ template  class 
__value_func<_Rp(_ArgTypes...)>
 _LIBCPP_INLINE_VISIBILITY
 explicit operator bool() const _NOEXCEPT { return __f_ != nullptr; }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
 _LIBCPP_INLINE_VISIBILITY
 const std::type_info& target_type() const _NOEXCEPT
 {
@@ -569,7 +569,7 @@ template  class 
__value_func<_Rp(_ArgTypes...)>
 return nullptr;
 return (const _Tp*)__f_->target(typeid(_Tp));
 }
-#endif // _LIBCPP_NO_RTTI
+#endif // _LIBCPP_HAS_NO_RTTI
 };
 
 // Storage for a functor object, to be used with __policy to manage copy and
@@ -616,7 +616,7 @@ struct __policy
 {
 static const _LIBCPP_CONSTEXPR __policy __policy_ = {nullptr, nullptr,
  true,
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
  &typeid(void)
 #else
  nullptr
@@ -642,7 +642,7 @@ struct __policy
 __choose_policy(/* is_small = */ false_type) {
   static const _LIBCPP_CONSTEXPR __policy __policy_ = {
   &__large_clone<_Fun>, &__large_destroy<_Fun>, false,
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
   &typeid(typename _Fun::_Target)
 #else
   nullptr
@@ -657,7 +657,7 @@ struct __policy
 {
 static const _LIBCPP_CONSTEXPR __policy __policy_ = {
 nullptr, nullptr, false,
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
 &typeid(typename _Fun::_Target)
 #else
 nullptr
@@ -861,7 +861,7 @@ template  class 
__policy_func<_Rp(_ArgTypes...)>
 return !__policy_->__is_null;
 }
 
-#ifndef _LIBCPP_NO_RTTI
+#ifndef _LIBCPP_HAS_NO_RTTI
 _LIBCPP_INLINE_VISIBILITY
 const std::type_info& target_type() const _NOEXCEPT
 {
@@ -878,7 +878,7 @@ template  class 
__policy_func<_Rp(_ArgTypes...)>
 else

[llvm-branch-commits] [flang] 0de11b4 - [Flang] Restrict emit-asm-from-mlir.mlir to be ran on specific targets using 'target=...'

2023-02-14 Thread Tobias Hieta via llvm-branch-commits

Author: Amy Kwan
Date: 2023-02-14T08:59:57+01:00
New Revision: 0de11b4790125e8f53e41515c4c7fec59ce59202

URL: 
https://github.com/llvm/llvm-project/commit/0de11b4790125e8f53e41515c4c7fec59ce59202
DIFF: 
https://github.com/llvm/llvm-project/commit/0de11b4790125e8f53e41515c4c7fec59ce59202.diff

LOG: [Flang] Restrict emit-asm-from-mlir.mlir to be ran on specific targets 
using 'target=...'

This patch aims to restrict the emit-asm-from-mlir.mlir test to the targets that
the test cases expect using the 'target=...' LIT expression.

rG9067de2a43145411eff8b7782a404c5834249717 has previously attempted to resolve
the LIT failure on the ppc64le-flang-rhel-clang buildbot coming from the
emit-asm-from-mlir.mlir test by restricting the test case for AArch64, x86 and
ARM (as long as these targets are built). The original solution of adding
"*-registered-target" works on ppc64le-flang-rhel-clang because this bot only
builds PowerPC in LLVM_TARGETS_TO_BUILD.

When we build all targets and also build the flang project, this test case will
fail because despite being on PowerPC, we are still building the AArch64, x86
and ARM targets which will cause this test to run. These targets expect the ret
instruction to be produced in this test case, while PowerPC produces a blr 
instead.

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

(cherry picked from commit 71513f761cb8d334f903986c875f7d16ab2ddeaf)

Added: 


Modified: 
flang/test/Driver/emit-asm-from-mlir.mlir

Removed: 




diff  --git a/flang/test/Driver/emit-asm-from-mlir.mlir 
b/flang/test/Driver/emit-asm-from-mlir.mlir
index 5b16d2938e783..99bbf1b93c42c 100644
--- a/flang/test/Driver/emit-asm-from-mlir.mlir
+++ b/flang/test/Driver/emit-asm-from-mlir.mlir
@@ -1,4 +1,4 @@
-// REQUIRES: aarch64-registered-target || x86-registered-target || 
arm-registered-target
+// REQUIRES: target=aarch64{{.*}} || target=x86{{.*}} || target=arm{{.*}}
 // Above restricts the test to those architectures that match "ret" to return
 // from a function.
 // Verify that the driver can consume MLIR/FIR files.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] eaca569 - [libc++] Fix bug in allocate_shared_for_overwrite

2023-02-14 Thread Tobias Hieta via llvm-branch-commits

Author: Louis Dionne
Date: 2023-02-14T09:00:14+01:00
New Revision: eaca569bb32634dcdab1a28c5435986698cc418b

URL: 
https://github.com/llvm/llvm-project/commit/eaca569bb32634dcdab1a28c5435986698cc418b
DIFF: 
https://github.com/llvm/llvm-project/commit/eaca569bb32634dcdab1a28c5435986698cc418b.diff

LOG: [libc++] Fix bug in allocate_shared_for_overwrite

Instead of destroying the object with allocator::destroy, we must
call its destructor directly. As a fly-by also mark LWG3008 as
fixed since it is handled by our implementation.

This was pointed out by Tim Song in https://reviews.llvm.org/D140913.

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

(cherry picked from commit 5801090258011cfe636cda1493ac9bc07fb2a889)

Added: 


Modified: 
libcxx/docs/Status/Cxx20Issues.csv
libcxx/include/__memory/construct_at.h
libcxx/include/__memory/shared_ptr.h

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_for_overwrite.pass.cpp
libcxx/test/support/test_allocator.h

Removed: 




diff  --git a/libcxx/docs/Status/Cxx20Issues.csv 
b/libcxx/docs/Status/Cxx20Issues.csv
index db0546147f1a8..2d2318af228d9 100644
--- a/libcxx/docs/Status/Cxx20Issues.csv
+++ b/libcxx/docs/Status/Cxx20Issues.csv
@@ -103,7 +103,7 @@
 "`2960 `__","[fund.ts.v3] ``nonesuch``\  is 
insufficiently useless","San Diego","|Complete|",""
 "`2995 `__","``basic_stringbuf``\  default 
constructor forbids it from using SSO capacity","San Diego","",""
 "`2996 `__","Missing rvalue overloads for 
``shared_ptr``\  operations","San Diego","",""
-"`3008 `__","``make_shared``\  (sub)object 
destruction semantics are not specified","San Diego","",""
+"`3008 `__","``make_shared``\  (sub)object 
destruction semantics are not specified","San Diego","|Complete|","16.0"
 "`3022 `__","``is_convertible``\  
may lead to ODR","San Diego","Resolved by 1285R0",""
 "`3025 `__","Map-like container deduction guides 
should use ``pair``\ , not ``pair``\ ","San 
Diego","|Complete|",""
 "`3031 `__","Algorithms and predicates with 
non-const reference arguments","San Diego","",""

diff  --git a/libcxx/include/__memory/construct_at.h 
b/libcxx/include/__memory/construct_at.h
index ffee0022c2433..14484dd6aa0d9 100644
--- a/libcxx/include/__memory/construct_at.h
+++ b/libcxx/include/__memory/construct_at.h
@@ -83,6 +83,16 @@ _ForwardIterator __destroy(_ForwardIterator __first, 
_ForwardIterator __last) {
 return __first;
 }
 
+template 
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
+_BidirectionalIterator __reverse_destroy(_BidirectionalIterator __first, 
_BidirectionalIterator __last) {
+while (__last != __first) {
+--__last;
+std::__destroy_at(std::addressof(*__last));
+}
+return __last;
+}
+
 #if _LIBCPP_STD_VER > 14
 
 template , int> = 0>

diff  --git a/libcxx/include/__memory/shared_ptr.h 
b/libcxx/include/__memory/shared_ptr.h
index 88c26fdb3809d..f0ffa26abfeb5 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -260,7 +260,10 @@ __shared_ptr_pointer<_Tp, _Dp, 
_Alloc>::__on_zero_shared_weak() _NOEXCEPT
 __a.deallocate(_PTraits::pointer_to(*this), 1);
 }
 
-struct __default_initialize_tag {};
+// This tag is used to instantiate an allocator type. The various shared_ptr 
control blocks
+// detect that the allocator has been instantiated for this type and perform 
alternative
+// initialization/destruction based on that.
+struct __for_overwrite_tag {};
 
 template 
 struct __shared_ptr_emplace
@@ -271,25 +274,20 @@ struct __shared_ptr_emplace
 explicit __shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
 : __storage_(_VSTD::move(__a))
 {
-#if _LIBCPP_STD_VER > 17
-using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
-_TpAlloc __tmp(*__get_alloc());
-allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), 
_VSTD::forward<_Args>(__args)...);
+#if _LIBCPP_STD_VER >= 20
+if constexpr (is_same_v) {
+static_assert(sizeof...(_Args) == 0, "No argument should be 
provided to the control block when using _for_overwrite");
+::new ((void*)__get_elem()) _Tp;
+} else {
+using _TpAlloc = typename __allocator_traits_rebind<_Alloc, 
_Tp>::type;
+_TpAlloc __tmp(*__get_alloc());
+allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), 
_VSTD::forward<_Args>(__args)...);
+}
 #else
 ::new ((void*)__get_elem()) _Tp(_VSTD::forward<_Args>(__args)...);
 #endif
 }
 
-
-#if _LIBCPP_STD_VER >= 20
-_LIBCPP_HIDE_FROM_ABI
-explicit __shared_ptr_emplace(__default_initialize_t

[llvm-branch-commits] [libcxx] ed47dbe - [libc++][NFC] Rename multidimentional uninitialized algorithms

2023-02-14 Thread Tobias Hieta via llvm-branch-commits

Author: Nikolas Klauser
Date: 2023-02-14T09:00:14+01:00
New Revision: ed47dbe5a74b21a08cb5fc5c928ecedd8f5ae104

URL: 
https://github.com/llvm/llvm-project/commit/ed47dbe5a74b21a08cb5fc5c928ecedd8f5ae104
DIFF: 
https://github.com/llvm/llvm-project/commit/ed47dbe5a74b21a08cb5fc5c928ecedd8f5ae104.diff

LOG: [libc++][NFC] Rename multidimentional uninitialized algorithms

Reviewed By: Mordante, #libc

Spies: libcxx-commits

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

(cherry picked from commit ba43f3e857390932fede4aedf3e57d8f3787e804)

Added: 


Modified: 
libcxx/include/__memory/shared_ptr.h
libcxx/include/__memory/uninitialized_algorithms.h

Removed: 




diff  --git a/libcxx/include/__memory/shared_ptr.h 
b/libcxx/include/__memory/shared_ptr.h
index b77ce9230bff4..6bb9ca968dfad 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -1000,14 +1000,14 @@ struct __unbounded_array_control_block<_Tp[], _Alloc> : 
__shared_weak_count
 explicit __unbounded_array_control_block(_Alloc const& __alloc, size_t 
__count, _Tp const& __arg)
 : __alloc_(__alloc), __count_(__count)
 {
-std::__uninitialized_allocator_fill_n(__alloc_, std::begin(__data_), 
__count_, __arg);
+std::__uninitialized_allocator_fill_n_multidimensional(__alloc_, 
std::begin(__data_), __count_, __arg);
 }
 
 _LIBCPP_HIDE_FROM_ABI
 explicit __unbounded_array_control_block(_Alloc const& __alloc, size_t 
__count)
 : __alloc_(__alloc), __count_(__count)
 {
-std::__uninitialized_allocator_value_construct_n(__alloc_, 
std::begin(__data_), __count_);
+
std::__uninitialized_allocator_value_construct_n_multidimensional(__alloc_, 
std::begin(__data_), __count_);
 }
 
 #if _LIBCPP_STD_VER >= 20
@@ -1096,12 +1096,12 @@ struct __bounded_array_control_block<_Tp[_Count], 
_Alloc>
 
 _LIBCPP_HIDE_FROM_ABI
 explicit __bounded_array_control_block(_Alloc const& __alloc, _Tp const& 
__arg) : __alloc_(__alloc) {
-std::__uninitialized_allocator_fill_n(__alloc_, 
std::addressof(__data_[0]), _Count, __arg);
+std::__uninitialized_allocator_fill_n_multidimensional(__alloc_, 
std::addressof(__data_[0]), _Count, __arg);
 }
 
 _LIBCPP_HIDE_FROM_ABI
 explicit __bounded_array_control_block(_Alloc const& __alloc) : 
__alloc_(__alloc) {
-std::__uninitialized_allocator_value_construct_n(__alloc_, 
std::addressof(__data_[0]), _Count);
+
std::__uninitialized_allocator_value_construct_n_multidimensional(__alloc_, 
std::addressof(__data_[0]), _Count);
 }
 
 #if _LIBCPP_STD_VER >= 20

diff  --git a/libcxx/include/__memory/uninitialized_algorithms.h 
b/libcxx/include/__memory/uninitialized_algorithms.h
index 63a45b2ac87b1..0067780c3f5d0 100644
--- a/libcxx/include/__memory/uninitialized_algorithms.h
+++ b/libcxx/include/__memory/uninitialized_algorithms.h
@@ -410,7 +410,7 @@ constexpr void __allocator_destroy_multidimensional(_Alloc& 
__alloc, _BidirIter
 // This function assumes that the allocator is bound to the correct type.
 template
 _LIBCPP_HIDE_FROM_ABI
-constexpr void __allocator_construct_at(_Alloc& __alloc, _Tp* __loc) {
+constexpr void __allocator_construct_at_multidimensional(_Alloc& __alloc, _Tp* 
__loc) {
 static_assert(is_same_v::value_type, 
_Tp>,
 "The allocator should already be rebound to the correct type");
 
@@ -426,7 +426,7 @@ constexpr void __allocator_construct_at(_Alloc& __alloc, 
_Tp* __loc) {
 });
 
 for (; __i != extent_v<_Tp>; ++__i) {
-std::__allocator_construct_at(__elem_alloc, 
std::addressof(__array[__i]));
+std::__allocator_construct_at_multidimensional(__elem_alloc, 
std::addressof(__array[__i]));
 }
 __guard.__complete();
 } else {
@@ -446,13 +446,13 @@ constexpr void __allocator_construct_at(_Alloc& __alloc, 
_Tp* __loc) {
 // This function assumes that the allocator is bound to the correct type.
 template
 _LIBCPP_HIDE_FROM_ABI
-constexpr void __allocator_construct_at(_Alloc& __alloc, _Tp* __loc, _Arg 
const& __arg) {
+constexpr void __allocator_construct_at_multidimensional(_Alloc& __alloc, _Tp* 
__loc, _Arg const& __arg) {
 static_assert(is_same_v::value_type, 
_Tp>,
 "The allocator should already be rebound to the correct type");
 
 if constexpr (is_array_v<_Tp>) {
 static_assert(is_array_v<_Arg>,
-"Provided non-array initialization argument to 
__allocator_construct_at when "
+"Provided non-array initialization argument to 
__allocator_construct_at_multidimensional when "
 "trying to construct an array.");
 
 using _Element = remove_extent_t<_Tp>;
@@ -465,7 +465,7 @@ constexpr void __allocator_construct_at(_Alloc& __alloc, 
_Tp* __loc, _Arg const&
   std::__allocator_destroy_multidimensional(__elem_alloc, __array, 
__array + _

[llvm-branch-commits] [openmp] 6d859df - [Libomptarget] Remove dependency on the DeviceRTL from the GPU plugins

2023-02-14 Thread Tobias Hieta via llvm-branch-commits

Author: Joseph Huber
Date: 2023-02-14T09:00:25+01:00
New Revision: 6d859df46e93e04bd7a4f90d9a9056763998f638

URL: 
https://github.com/llvm/llvm-project/commit/6d859df46e93e04bd7a4f90d9a9056763998f638
DIFF: 
https://github.com/llvm/llvm-project/commit/6d859df46e93e04bd7a4f90d9a9056763998f638.diff

LOG: [Libomptarget] Remove dependency on the DeviceRTL from the GPU plugins

The GPU plugins have a dependency on the device libraries. Sometimes we
cannot build the device libraries because the user does not have a valid
`clang` to use or it was explicitly disabled. Currently this leads to a
transitive failure because we cannot meet this dependency. This patch
simply removes that dependency.

Fixes https://github.com/llvm/llvm-project/issues/60457

Reviewed By: tianshilei1992

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

(cherry picked from commit 9f650ae779b4d7e033f5f17290aad50e935424d2)

Added: 


Modified: 
openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt
openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt
openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
openmp/libomptarget/plugins/cuda/CMakeLists.txt

Removed: 




diff  --git a/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt 
b/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt
index b469850297ecc..8f234eebe1e4a 100644
--- a/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt
+++ b/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt
@@ -90,7 +90,6 @@ add_llvm_library(omptarget.rtl.amdgpu.nextgen SHARED
 
   NO_INSTALL_RPATH
 )
-add_dependencies(omptarget.rtl.amdgpu.nextgen omptarget.devicertl.amdgpu)
 
 target_include_directories(
   omptarget.rtl.amdgpu.nextgen

diff  --git a/openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt 
b/openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt
index 02cf47b405caf..da19ec3e7d2dd 100644
--- a/openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt
+++ b/openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt
@@ -85,7 +85,6 @@ else()
 NO_INSTALL_RPATH
   )
 endif()
-add_dependencies(omptarget.rtl.cuda.nextgen omptarget.devicertl.nvptx)
 
 # Install plugin under the lib destination folder.
 install(TARGETS omptarget.rtl.cuda.nextgen LIBRARY DESTINATION 
"${OPENMP_INSTALL_LIBDIR}")

diff  --git a/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt 
b/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
index 4d8f9050fd004..1619f1e451af2 100644
--- a/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
+++ b/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
@@ -90,7 +90,6 @@ add_llvm_library(omptarget.rtl.amdgpu SHARED
 
   NO_INSTALL_RPATH
 )
-add_dependencies(omptarget.rtl.amdgpu omptarget.devicertl.amdgpu)
 
 target_include_directories(
   omptarget.rtl.amdgpu

diff  --git a/openmp/libomptarget/plugins/cuda/CMakeLists.txt 
b/openmp/libomptarget/plugins/cuda/CMakeLists.txt
index 520c6b0365de2..6d0b767cecbb3 100644
--- a/openmp/libomptarget/plugins/cuda/CMakeLists.txt
+++ b/openmp/libomptarget/plugins/cuda/CMakeLists.txt
@@ -82,7 +82,6 @@ else()
 NO_INSTALL_RPATH
   )
 endif()
-add_dependencies(omptarget.rtl.cuda omptarget.devicertl.nvptx)
 
 # Install plugin under the lib destination folder.
 install(TARGETS omptarget.rtl.cuda LIBRARY DESTINATION 
"${OPENMP_INSTALL_LIBDIR}")



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] 0d4e55b - [OpenMP] Recover non-blocking target nowait disabled by D141232

2023-02-14 Thread Ye Luo via llvm-branch-commits

Author: Ye Luo
Date: 2023-02-14T15:48:38-06:00
New Revision: 0d4e55ba69c1dd04913c59d39c764c8070e55c60

URL: 
https://github.com/llvm/llvm-project/commit/0d4e55ba69c1dd04913c59d39c764c8070e55c60
DIFF: 
https://github.com/llvm/llvm-project/commit/0d4e55ba69c1dd04913c59d39c764c8070e55c60.diff

LOG: [OpenMP] Recover non-blocking target nowait disabled by D141232

Reviewed By: jdoerfert

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

Added: 


Modified: 
openmp/libomptarget/src/interface.cpp

Removed: 




diff  --git a/openmp/libomptarget/src/interface.cpp 
b/openmp/libomptarget/src/interface.cpp
index 91dda62b0c2d5..beea0c26210bc 100644
--- a/openmp/libomptarget/src/interface.cpp
+++ b/openmp/libomptarget/src/interface.cpp
@@ -299,8 +299,12 @@ EXTERN int __tgt_target_kernel(ident_t *Loc, int64_t 
DeviceId, int32_t NumTeams,
int32_t ThreadLimit, void *HostPtr,
KernelArgsTy *KernelArgs) {
   TIMESCOPE_WITH_IDENT(Loc);
-  return targetKernel(Loc, DeviceId, NumTeams, ThreadLimit,
-   HostPtr, KernelArgs);
+  if (KernelArgs->Flags.NoWait)
+return targetKernel(
+Loc, DeviceId, NumTeams, ThreadLimit, HostPtr, KernelArgs);
+  else
+return targetKernel(Loc, DeviceId, NumTeams, ThreadLimit,
+ HostPtr, KernelArgs);
 }
 
 /// Implements a target kernel entry that replays a pre-recorded kernel.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits