Skip to content

Commit 69746ca

Browse files
committed
Merge remote-tracking branch 'origin/main' into pr/gisel-itofp
2 parents f9ac147 + da032b7 commit 69746ca

File tree

77 files changed

+2750
-2112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2750
-2112
lines changed

clang/lib/AST/ByteCode/DynamicAllocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class DynamicAllocator final {
9797
private:
9898
llvm::DenseMap<const Expr *, AllocationSite> AllocationSites;
9999

100-
using PoolAllocTy = llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator>;
100+
using PoolAllocTy = llvm::BumpPtrAllocator;
101101
PoolAllocTy DescAllocator;
102102

103103
/// Allocates a new descriptor.

clang/lib/AST/ByteCode/Program.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class Program final {
171171
llvm::DenseMap<const void *, unsigned> NativePointerIndices;
172172

173173
/// Custom allocator for global storage.
174-
using PoolAllocTy = llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator>;
174+
using PoolAllocTy = llvm::BumpPtrAllocator;
175175

176176
/// Descriptor + storage for a global object.
177177
///

clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ class DependencyScanningAction : public tooling::ToolAction {
335335

336336
ScanInstance.getFrontendOpts().GenerateGlobalModuleIndex = false;
337337
ScanInstance.getFrontendOpts().UseGlobalModuleIndex = false;
338-
ScanInstance.getFrontendOpts().ModulesShareFileManager = false;
338+
// This will prevent us compiling individual modules asynchronously since
339+
// FileManager is not thread-safe, but it does improve performance for now.
340+
ScanInstance.getFrontendOpts().ModulesShareFileManager = true;
339341
ScanInstance.getHeaderSearchOpts().ModuleFormat = "raw";
340342
ScanInstance.getHeaderSearchOpts().ModulesIncludeVFSUsage =
341343
any(OptimizeArgs & ScanningOptimizations::VFS);

compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,11 @@ size_t PageSize() {
239239
}
240240

241241
void SetThreadName(std::thread &thread, const std::string &name) {
242-
#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) || \
243-
defined(_GLIBCXX_GCC_GTHR_POSIX_H)
244-
(void)pthread_setname_np(thread.native_handle(), name.c_str());
245-
#else
242+
#ifndef __MINGW32__
243+
// Not setting the thread name in MinGW environments. MinGW C++ standard
244+
// libraries can either use native Windows threads or pthreads, so we
245+
// don't know with certainty what kind of thread handle we're getting
246+
// from thread.native_handle() here.
246247
typedef HRESULT(WINAPI * proc)(HANDLE, PCWSTR);
247248
HMODULE kbase = GetModuleHandleA("KernelBase.dll");
248249
proc ThreadNameProc = reinterpret_cast<proc>(

flang/include/flang/Common/Fortran.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ static constexpr IgnoreTKRSet ignoreTKRAll{IgnoreTKR::Type, IgnoreTKR::Kind,
118118
std::string AsFortran(IgnoreTKRSet);
119119

120120
bool AreCompatibleCUDADataAttrs(std::optional<CUDADataAttr>,
121-
std::optional<CUDADataAttr>, IgnoreTKRSet, bool allowUnifiedMatchingRule,
121+
std::optional<CUDADataAttr>, IgnoreTKRSet, std::optional<std::string> *,
122+
bool allowUnifiedMatchingRule,
122123
const LanguageFeatureControl *features = nullptr);
123124

124125
static constexpr char blankCommonObjectName[] = "__BLNK__";

flang/lib/Common/Fortran.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ std::string AsFortran(IgnoreTKRSet tkr) {
103103
/// dummy argument attribute while `y` represents the actual argument attribute.
104104
bool AreCompatibleCUDADataAttrs(std::optional<CUDADataAttr> x,
105105
std::optional<CUDADataAttr> y, IgnoreTKRSet ignoreTKR,
106-
bool allowUnifiedMatchingRule, const LanguageFeatureControl *features) {
106+
std::optional<std::string> *warning, bool allowUnifiedMatchingRule,
107+
const LanguageFeatureControl *features) {
107108
bool isCudaManaged{features
108109
? features->IsEnabled(common::LanguageFeature::CudaManaged)
109110
: false};
@@ -134,8 +135,12 @@ bool AreCompatibleCUDADataAttrs(std::optional<CUDADataAttr> x,
134135
} else {
135136
if (*x == CUDADataAttr::Device) {
136137
if ((y &&
137-
(*y == CUDADataAttr::Managed || *y == CUDADataAttr::Unified)) ||
138+
(*y == CUDADataAttr::Managed || *y == CUDADataAttr::Unified ||
139+
*y == CUDADataAttr::Shared)) ||
138140
(!y && (isCudaUnified || isCudaManaged))) {
141+
if (y && *y == CUDADataAttr::Shared && warning) {
142+
*warning = "SHARED attribute ignored"s;
143+
}
139144
return true;
140145
}
141146
} else if (*x == CUDADataAttr::Managed) {

flang/lib/Evaluate/characteristics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ bool DummyDataObject::IsCompatibleWith(const DummyDataObject &actual,
371371
}
372372
if (!attrs.test(Attr::Value) &&
373373
!common::AreCompatibleCUDADataAttrs(cudaDataAttr, actual.cudaDataAttr,
374-
ignoreTKR,
374+
ignoreTKR, warning,
375375
/*allowUnifiedMatchingRule=*/false)) {
376376
if (whyNot) {
377377
*whyNot = "incompatible CUDA data attributes";
@@ -1771,7 +1771,7 @@ bool DistinguishUtils::Distinguishable(
17711771
x.intent != common::Intent::In) {
17721772
return true;
17731773
} else if (!common::AreCompatibleCUDADataAttrs(x.cudaDataAttr, y.cudaDataAttr,
1774-
x.ignoreTKR | y.ignoreTKR,
1774+
x.ignoreTKR | y.ignoreTKR, nullptr,
17751775
/*allowUnifiedMatchingRule=*/false)) {
17761776
return true;
17771777
} else if (features_.IsEnabled(

flang/lib/Semantics/check-call.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,9 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy,
976976
actualDataAttr = common::CUDADataAttr::Device;
977977
}
978978
}
979+
std::optional<std::string> warning;
979980
if (!common::AreCompatibleCUDADataAttrs(dummyDataAttr, actualDataAttr,
980-
dummy.ignoreTKR,
981+
dummy.ignoreTKR, &warning,
981982
/*allowUnifiedMatchingRule=*/true, &context.languageFeatures())) {
982983
auto toStr{[](std::optional<common::CUDADataAttr> x) {
983984
return x ? "ATTRIBUTES("s +
@@ -988,6 +989,10 @@ static void CheckExplicitDataArg(const characteristics::DummyDataObject &dummy,
988989
"%s has %s but its associated actual argument has %s"_err_en_US,
989990
dummyName, toStr(dummyDataAttr), toStr(actualDataAttr));
990991
}
992+
if (warning && context.ShouldWarn(common::UsageWarning::CUDAUsage)) {
993+
messages.Say(common::UsageWarning::CUDAUsage, "%s"_warn_en_US,
994+
std::move(*warning));
995+
}
991996
}
992997

993998
// Warning for breaking F'2023 change with character allocatables

flang/test/Semantics/cuf17.cuf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
! RUN: bbc -emit-hlfir -fcuda %s 2>&1 | FileCheck %s
2+
3+
module mod1
4+
contains
5+
6+
attributes(device) subroutine sub1(adev)
7+
real, device :: adev(10)
8+
end
9+
10+
attributes(global) subroutine sub2()
11+
real, shared :: adev(10)
12+
!WARNING: SHARED attribute ignored
13+
call sub1(adev)
14+
end subroutine
15+
16+
end module
17+
18+
! CHECK: warning: SHARED attribute ignored

libcxxabi/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ set(LIBCXXABI_STATIC_OUTPUT_NAME "c++abi" CACHE STRING "Output name for the stat
8686

8787
set(LIBCXXABI_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/c++/v1" CACHE STRING "Path to install the libc++abi headers at.")
8888

89+
if(LLVM_LIBRARY_OUTPUT_INTDIR)
90+
set(LIBCXXABI_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1")
91+
else()
92+
set(LIBCXXABI_GENERATED_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/c++/v1")
93+
endif()
94+
8995
set(LIBCXXABI_LIBCXX_LIBRARY_PATH "" CACHE PATH "The path to libc++ library.")
9096
set(LIBCXXABI_LIBRARY_VERSION "1.0" CACHE STRING
9197
"Version of libc++abi. This will be reflected in the name of the shared \

0 commit comments

Comments
 (0)