Big-merge update to LLVM 19

Related: RHEL-57461
Related: RHEL-38228
This commit is contained in:
Konrad Kleine 2024-11-09 19:00:50 +01:00
parent 077d823076
commit fa99d30e02
24 changed files with 2919 additions and 367 deletions

30
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,30 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- id: fix-byte-order-marker
- id: detect-private-key
- id: check-toml
- id: check-yaml
args:
- "--allow-multiple-documents"
- "--unsafe"
# See https://tmt.readthedocs.io/en/latest/guide.html#checking-data-validity
- repo: https://github.com/teemtee/tmt.git
rev: 1.38.0
hooks:
- id: tmt-lint
exclude: ".*\\.patch"

View File

@ -0,0 +1,29 @@
From b1c60d7fa322a2d208556087df9e7ef94bfbffb8 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Wed, 8 May 2024 12:30:36 +0900
Subject: [PATCH] Always build shared libs for LLD
We don't want to enable BUILD_SHARED_LIBS for the whole build,
but we do want to build lld libraries.
---
lld/cmake/modules/AddLLD.cmake | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lld/cmake/modules/AddLLD.cmake b/lld/cmake/modules/AddLLD.cmake
index 2ee066b41535..270c03f096ac 100644
--- a/lld/cmake/modules/AddLLD.cmake
+++ b/lld/cmake/modules/AddLLD.cmake
@@ -7,9 +7,8 @@ macro(add_lld_library name)
""
""
${ARGN})
- if(ARG_SHARED)
- set(ARG_ENABLE_SHARED SHARED)
- endif()
+ # Always build shared libs for LLD.
+ set(ARG_ENABLE_SHARED SHARED)
llvm_add_library(${name} ${ARG_ENABLE_SHARED} ${ARG_UNPARSED_ARGUMENTS})
set_target_properties(${name} PROPERTIES FOLDER "lld libraries")
--
2.44.0

View File

@ -0,0 +1,30 @@
From 69faadbc396000bfa60c722f6fb9c0fc3fb2daf0 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Wed, 8 May 2024 12:30:36 +0900
Subject: [PATCH] Always build shared libs for LLD
We don't want to enable BUILD_SHARED_LIBS for the whole build,
but we do want to build lld libraries.
---
lld/cmake/modules/AddLLD.cmake | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lld/cmake/modules/AddLLD.cmake b/lld/cmake/modules/AddLLD.cmake
index 9f2684b6f933..743ec87814a2 100644
--- a/lld/cmake/modules/AddLLD.cmake
+++ b/lld/cmake/modules/AddLLD.cmake
@@ -7,9 +7,8 @@ macro(add_lld_library name)
""
""
${ARGN})
- if(ARG_SHARED)
- set(ARG_ENABLE_SHARED SHARED)
- endif()
+ # Always build shared libs for LLD.
+ set(ARG_ENABLE_SHARED SHARED)
llvm_add_library(${name} ${ARG_ENABLE_SHARED} ${ARG_UNPARSED_ARGUMENTS})
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
--
2.45.1

View File

@ -0,0 +1,41 @@
From d8742e9b361e5fd6fee2298b8ea0aeb4671ec05a Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Wed, 22 May 2024 09:39:26 +0200
Subject: [PATCH] Remove myst_parser dependency for RHEL
---
clang/docs/conf.py | 3 +--
llvm/docs/conf.py | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/clang/docs/conf.py b/clang/docs/conf.py
index 4cee382a718f..d2e2198e05d4 100644
--- a/clang/docs/conf.py
+++ b/clang/docs/conf.py
@@ -43,8 +43,7 @@ try:
extensions.append("myst_parser")
except ImportError:
- if not tags.has("builder-man"):
- raise
+ pass
# The encoding of source files.
diff --git a/llvm/docs/conf.py b/llvm/docs/conf.py
index 7f2ed5309606..354a41f11280 100644
--- a/llvm/docs/conf.py
+++ b/llvm/docs/conf.py
@@ -36,8 +36,7 @@ try:
extensions.append("myst_parser")
except ImportError:
- if not tags.has("builder-man"):
- raise
+ pass
# Automatic anchors for markdown titles
from llvm_slug import make_slug
--
2.44.0

View File

@ -0,0 +1,43 @@
From 50cd36c2156d375a6d50f661908b460fbbd22e78 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Wed, 22 May 2024 09:39:26 +0200
Subject: [PATCH] Remove myst_parser dependency for RHEL
---
clang/docs/conf.py | 3 +--
llvm/docs/conf.py | 5 +----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/clang/docs/conf.py b/clang/docs/conf.py
index 4cee382a718f..d2e2198e05d4 100644
--- a/clang/docs/conf.py
+++ b/clang/docs/conf.py
@@ -43,8 +43,7 @@ try:
extensions.append("myst_parser")
except ImportError:
- if not tags.has("builder-man"):
- raise
+ pass
# The encoding of source files.
diff --git a/llvm/docs/conf.py b/llvm/docs/conf.py
index d9fa6961032b..e38c009a457d 100644
--- a/llvm/docs/conf.py
+++ b/llvm/docs/conf.py
@@ -36,10 +36,7 @@ try:
extensions.append("myst_parser")
except ImportError:
- if not tags.has("builder-man"):
- raise
-else:
- myst_enable_extensions = ["substitution"]
+ pass
# Automatic anchors for markdown titles
myst_heading_anchors = 6
--
2.46.0

View File

@ -0,0 +1,41 @@
From 73d3b4047d757ef35850e2cef38285b96be82f0f Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Tue, 23 May 2023 12:17:29 +0200
Subject: [PATCH] [Driver] Give devtoolset path precedence over InstalledDir
This is a followup to the change from c5fe10f365247c3dd9416b7ec8bad73a60b5946e.
While that commit correctly adds the bindir from devtoolset to the
path, the driver dir / install dir still comes first. This means
we'll still end up picking /usr/bin/ld rather than the one from
devtoolset.
Unfortunately, I don't see any way to test this. In the environment
the tests are run, this would only result in a behavior difference
if there is an ld binary present in the LLVM build directory, which
isn't the case.
Differential Revision: https://reviews.llvm.org/D151203
---
clang/lib/Driver/ToolChains/Linux.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
index 853ff99d9fe5..aecabb46d4b9 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -244,9 +244,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
// With devtoolset on RHEL, we want to add a bin directory that is relative
// to the detected gcc install, because if we are using devtoolset gcc then
// we want to use other tools from devtoolset (e.g. ld) instead of the
- // standard system tools.
- PPaths.push_back(Twine(GCCInstallation.getParentLibPath() +
- "/../bin").str());
+ // standard system tools. This should take precedence over InstalledDir.
+ PPaths.insert(PPaths.begin(),
+ Twine(GCCInstallation.getParentLibPath() + "/../bin").str());
if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb)
ExtraOpts.push_back("-X");
--
2.40.1

View File

@ -0,0 +1,25 @@
From 5f73befe5a0df82e455f4b1052e62f34009e98bb Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Tue, 23 Apr 2024 15:08:34 -0700
Subject: [PATCH] Fix page size constant on aarch64 and ppc64le
---
compiler-rt/lib/cfi/cfi.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/compiler-rt/lib/cfi/cfi.cpp b/compiler-rt/lib/cfi/cfi.cpp
index ad1c91623514..e7e86e5807a8 100644
--- a/compiler-rt/lib/cfi/cfi.cpp
+++ b/compiler-rt/lib/cfi/cfi.cpp
@@ -53,6 +53,8 @@ namespace __cfi {
#if SANITIZER_LOONGARCH64
#define kCfiShadowLimitsStorageSize 16384 // 16KiB on loongarch64 per page
+#elif defined(__aarch64__) || defined(__powerpc64__)
+#define kCfiShadowLimitsStorageSize 65536 // 1 page
#else
#define kCfiShadowLimitsStorageSize 4096 // 1 page
#endif
--
2.40.1

View File

@ -0,0 +1,27 @@
From 49f827b09db549de62dcaf8b90b3fcb3e08c0ee5 Mon Sep 17 00:00:00 2001
From: Serge Guelton <sguelton@redhat.com>
Date: Mon, 6 Mar 2023 12:37:48 +0100
Subject: [PATCH] Make -funwind-tables the default on all archs
---
clang/lib/Driver/ToolChains/Gnu.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 24fbdcffc07b..8fed46b49515 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2904,6 +2904,10 @@ Generic_GCC::getDefaultUnwindTableLevel(const ArgList &Args) const {
case llvm::Triple::riscv64:
case llvm::Triple::x86:
case llvm::Triple::x86_64:
+ // Enable -funwind-tables on all architectures supported by Fedora:
+ // rhbz#1655546
+ case llvm::Triple::systemz:
+ case llvm::Triple::arm:
return UnwindTableLevel::Asynchronous;
default:
return UnwindTableLevel::None;
--
2.39.1

View File

@ -0,0 +1,30 @@
From a2449cee8c995b56f1892502aab3dfad3d6f3ca1 Mon Sep 17 00:00:00 2001
From: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
Date: Fri, 8 Sep 2023 11:45:34 -0300
Subject: [PATCH] Workaround a bug in ORC on ppc64le
The Jit code appears to be returning the wrong printf symbol on ppc64le
after the transition of the default long double to IEEE 128-bit floating
point.
---
clang/unittests/Interpreter/InterpreterTest.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/clang/unittests/Interpreter/InterpreterTest.cpp b/clang/unittests/Interpreter/InterpreterTest.cpp
index abb8e6377aab..7b6697ebc6ed 100644
--- a/clang/unittests/Interpreter/InterpreterTest.cpp
+++ b/clang/unittests/Interpreter/InterpreterTest.cpp
@@ -243,7 +243,9 @@ TEST(IncrementalProcessing, FindMangledNameSymbol) {
EXPECT_FALSE(!Addr);
// FIXME: Re-enable when we investigate the way we handle dllimports on Win.
-#ifndef _WIN32
+ // FIXME: The printf symbol returned from the Jit may not be correct on
+ // ppc64le when the default long double is IEEE 128-bit fp.
+#if !defined _WIN32 && !(defined __PPC64__ && defined __LITTLE_ENDIAN__)
EXPECT_EQ((uintptr_t)&printf, Addr->getValue());
#endif // _WIN32
}
--
2.41.0

View File

@ -0,0 +1,62 @@
From b2edeb58b8cb3268acee425cd52b406eb60a8095 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Wed, 9 Oct 2024 11:29:30 +0200
Subject: [PATCH] [openmp] Add option to disable tsan tests (#111548)
This adds a OPENMP_TEST_ENABLE_TSAN option that allows to override
whether tests using tsan will be enabled. The option defaults to the
existing auto-detection.
The background here is
https://github.com/llvm/llvm-project/issues/111492, where we have some
systems where tsan doesn't work, but we do still want to build it and
run tests that don't use tsan.
---
openmp/cmake/OpenMPTesting.cmake | 3 +++
openmp/tools/archer/tests/CMakeLists.txt | 2 +-
openmp/tools/archer/tests/lit.site.cfg.in | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake
index c67ad8b1cbd9..14cc5c67d84c 100644
--- a/openmp/cmake/OpenMPTesting.cmake
+++ b/openmp/cmake/OpenMPTesting.cmake
@@ -163,6 +163,9 @@ else()
set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS 1)
endif()
+set(OPENMP_TEST_ENABLE_TSAN "${OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS}" CACHE BOOL
+ "Whether to enable tests using tsan")
+
# Function to set compiler features for use in lit.
function(update_test_compiler_features)
set(FEATURES "[")
diff --git a/openmp/tools/archer/tests/CMakeLists.txt b/openmp/tools/archer/tests/CMakeLists.txt
index 5de91148fa4b..412c7d63725e 100644
--- a/openmp/tools/archer/tests/CMakeLists.txt
+++ b/openmp/tools/archer/tests/CMakeLists.txt
@@ -28,7 +28,7 @@ macro(pythonize_bool var)
endmacro()
pythonize_bool(LIBARCHER_HAVE_LIBATOMIC)
-pythonize_bool(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS)
+pythonize_bool(OPENMP_TEST_ENABLE_TSAN)
set(ARCHER_TSAN_TEST_DEPENDENCE "")
if(TARGET tsan)
diff --git a/openmp/tools/archer/tests/lit.site.cfg.in b/openmp/tools/archer/tests/lit.site.cfg.in
index 55edfde9738e..ddcb7b8bc3a5 100644
--- a/openmp/tools/archer/tests/lit.site.cfg.in
+++ b/openmp/tools/archer/tests/lit.site.cfg.in
@@ -12,7 +12,7 @@ config.omp_library_dir = "@LIBOMP_LIBRARY_DIR@"
config.omp_header_dir = "@LIBOMP_INCLUDE_DIR@"
config.operating_system = "@CMAKE_SYSTEM_NAME@"
config.has_libatomic = @LIBARCHER_HAVE_LIBATOMIC@
-config.has_tsan = @OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS@
+config.has_tsan = @OPENMP_TEST_ENABLE_TSAN@
config.test_archer_flags = "@LIBARCHER_TEST_FLAGS@"
config.libarcher_obj_root = "@CMAKE_CURRENT_BINARY_DIR@"
--
2.46.0

View File

@ -0,0 +1,205 @@
From 5fb4d7f6079a76b2907ccc8c53c7c509c30a3dca Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Thu, 10 Oct 2024 12:47:33 +0000
Subject: [PATCH] [openmp] Use core_siblings_list if physical_package_id not
available
On powerpc, physical_package_id may not be available. Currently,
this causes openmp to fall back to flat topology and various
affinity tests fail.
Fix this by parsing core_siblings_list to deterimine which cpus
belong to the same socket. This matches what the testing code
does. The code to parse the CPU list format thankfully already
exists.
Fixes https://github.com/llvm/llvm-project/issues/111809.
---
openmp/runtime/src/kmp_affinity.cpp | 100 +++++++++++++------
openmp/runtime/test/affinity/kmp-hw-subset.c | 2 +-
2 files changed, 72 insertions(+), 30 deletions(-)
diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp
index cf5cad04eb57..c3d5ecf1345e 100644
--- a/openmp/runtime/src/kmp_affinity.cpp
+++ b/openmp/runtime/src/kmp_affinity.cpp
@@ -1589,15 +1589,13 @@ kmp_str_buf_t *__kmp_affinity_str_buf_mask(kmp_str_buf_t *buf,
return buf;
}
-// Return (possibly empty) affinity mask representing the offline CPUs
-// Caller must free the mask
-kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() {
- kmp_affin_mask_t *offline;
- KMP_CPU_ALLOC(offline);
- KMP_CPU_ZERO(offline);
+static kmp_affin_mask_t *__kmp_parse_cpu_list(const char *path) {
+ kmp_affin_mask_t *mask;
+ KMP_CPU_ALLOC(mask);
+ KMP_CPU_ZERO(mask);
#if KMP_OS_LINUX
int n, begin_cpu, end_cpu;
- kmp_safe_raii_file_t offline_file;
+ kmp_safe_raii_file_t file;
auto skip_ws = [](FILE *f) {
int c;
do {
@@ -1606,29 +1604,29 @@ kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() {
if (c != EOF)
ungetc(c, f);
};
- // File contains CSV of integer ranges representing the offline CPUs
+ // File contains CSV of integer ranges representing the CPUs
// e.g., 1,2,4-7,9,11-15
- int status = offline_file.try_open("/sys/devices/system/cpu/offline", "r");
+ int status = file.try_open(path, "r");
if (status != 0)
- return offline;
- while (!feof(offline_file)) {
- skip_ws(offline_file);
- n = fscanf(offline_file, "%d", &begin_cpu);
+ return mask;
+ while (!feof(file)) {
+ skip_ws(file);
+ n = fscanf(file, "%d", &begin_cpu);
if (n != 1)
break;
- skip_ws(offline_file);
- int c = fgetc(offline_file);
+ skip_ws(file);
+ int c = fgetc(file);
if (c == EOF || c == ',') {
// Just single CPU
end_cpu = begin_cpu;
} else if (c == '-') {
// Range of CPUs
- skip_ws(offline_file);
- n = fscanf(offline_file, "%d", &end_cpu);
+ skip_ws(file);
+ n = fscanf(file, "%d", &end_cpu);
if (n != 1)
break;
- skip_ws(offline_file);
- c = fgetc(offline_file); // skip ','
+ skip_ws(file);
+ c = fgetc(file); // skip ','
} else {
// Syntax problem
break;
@@ -1638,13 +1636,19 @@ kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() {
end_cpu >= __kmp_xproc || begin_cpu > end_cpu) {
continue;
}
- // Insert [begin_cpu, end_cpu] into offline mask
+ // Insert [begin_cpu, end_cpu] into mask
for (int cpu = begin_cpu; cpu <= end_cpu; ++cpu) {
- KMP_CPU_SET(cpu, offline);
+ KMP_CPU_SET(cpu, mask);
}
}
#endif
- return offline;
+ return mask;
+}
+
+// Return (possibly empty) affinity mask representing the offline CPUs
+// Caller must free the mask
+kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() {
+ return __kmp_parse_cpu_list("/sys/devices/system/cpu/offline");
}
// Return the number of available procs
@@ -3175,6 +3179,37 @@ static inline const char *__kmp_cpuinfo_get_envvar() {
return envvar;
}
+static bool __kmp_package_id_from_core_siblings_list(unsigned **threadInfo,
+ unsigned num_avail,
+ unsigned idx) {
+ if (!KMP_AFFINITY_CAPABLE())
+ return false;
+
+ char path[256];
+ KMP_SNPRINTF(path, sizeof(path),
+ "/sys/devices/system/cpu/cpu%u/topology/core_siblings_list",
+ threadInfo[idx][osIdIndex]);
+ kmp_affin_mask_t *siblings = __kmp_parse_cpu_list(path);
+ for (unsigned i = 0; i < num_avail; ++i) {
+ unsigned cpu_id = threadInfo[i][osIdIndex];
+ KMP_ASSERT(cpu_id < __kmp_affin_mask_size * CHAR_BIT);
+ if (!KMP_CPU_ISSET(cpu_id, siblings))
+ continue;
+ if (threadInfo[i][pkgIdIndex] == UINT_MAX) {
+ // Arbitrarily pick the first index we encounter, it only matters that
+ // the value is the same for all siblings.
+ threadInfo[i][pkgIdIndex] = idx;
+ } else if (threadInfo[i][pkgIdIndex] != idx) {
+ // Contradictory sibling lists.
+ KMP_CPU_FREE(siblings);
+ return false;
+ }
+ }
+ KMP_ASSERT(threadInfo[idx][pkgIdIndex] != UINT_MAX);
+ KMP_CPU_FREE(siblings);
+ return true;
+}
+
// Parse /proc/cpuinfo (or an alternate file in the same format) to obtain the
// affinity map. On AIX, the map is obtained through system SRAD (Scheduler
// Resource Allocation Domain).
@@ -3550,18 +3585,13 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line,
return false;
}
- // Check for missing fields. The osId field must be there, and we
- // currently require that the physical id field is specified, also.
+ // Check for missing fields. The osId field must be there. The physical
+ // id field will be checked later.
if (threadInfo[num_avail][osIdIndex] == UINT_MAX) {
CLEANUP_THREAD_INFO;
*msg_id = kmp_i18n_str_MissingProcField;
return false;
}
- if (threadInfo[0][pkgIdIndex] == UINT_MAX) {
- CLEANUP_THREAD_INFO;
- *msg_id = kmp_i18n_str_MissingPhysicalIDField;
- return false;
- }
// Skip this proc if it is not included in the machine model.
if (KMP_AFFINITY_CAPABLE() &&
@@ -3591,6 +3621,18 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line,
}
*line = 0;
+ // At least on powerpc, Linux may return -1 for physical_package_id. Try
+ // to reconstruct topology from core_siblings_list in that case.
+ for (i = 0; i < num_avail; ++i) {
+ if (threadInfo[i][pkgIdIndex] == UINT_MAX) {
+ if (!__kmp_package_id_from_core_siblings_list(threadInfo, num_avail, i)) {
+ CLEANUP_THREAD_INFO;
+ *msg_id = kmp_i18n_str_MissingPhysicalIDField;
+ return false;
+ }
+ }
+ }
+
#if KMP_MIC && REDUCE_TEAM_SIZE
unsigned teamSize = 0;
#endif // KMP_MIC && REDUCE_TEAM_SIZE
diff --git a/openmp/runtime/test/affinity/kmp-hw-subset.c b/openmp/runtime/test/affinity/kmp-hw-subset.c
index 606fcdfbada9..0b49969bd3b1 100644
--- a/openmp/runtime/test/affinity/kmp-hw-subset.c
+++ b/openmp/runtime/test/affinity/kmp-hw-subset.c
@@ -25,7 +25,7 @@ static int compare_hw_subset_places(const place_list_t *openmp_places,
expected_per_place = nthreads_per_core;
} else {
expected_total = nsockets;
- expected_per_place = ncores_per_socket;
+ expected_per_place = ncores_per_socket * nthreads_per_core;
}
if (openmp_places->num_places != expected_total) {
fprintf(stderr, "error: KMP_HW_SUBSET did not half each resource layer!\n");
--
2.47.0

View File

@ -0,0 +1,25 @@
From 88704fc2eabb9dd19a9c3eb81a9b3dc37d95651c Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Fri, 31 Jan 2020 11:04:57 -0800
Subject: [PATCH][clang] Don't install static libraries
---
clang/cmake/modules/AddClang.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake
index 5752f4277444..0f52822d91f0 100644
--- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake
@@ -113,7 +113,7 @@ macro(add_clang_library name)
if(TARGET ${lib})
target_link_libraries(${lib} INTERFACE ${LLVM_COMMON_LIBS})
- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)
+ if (ARG_SHARED AND (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN))
get_target_export_arg(${name} Clang export_to_clangtargets UMBRELLA clang-libraries)
install(TARGETS ${lib}
COMPONENT ${lib}
--
2.30.2

View File

@ -1,13 +0,0 @@
diff --git a/llvm/docs/conf.py b/llvm/docs/conf.py
index cf8a75980b53..b208ad138e89 100644
--- a/llvm/docs/conf.py
+++ b/llvm/docs/conf.py
@@ -26,7 +26,7 @@ from datetime import date
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ["myst_parser", "sphinx.ext.intersphinx", "sphinx.ext.todo"]
+extensions = ["sphinx.ext.intersphinx", "sphinx.ext.todo"]
# Automatic anchors for markdown titles
from llvm_slug import make_slug

View File

@ -1,46 +0,0 @@
diff --git a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
--- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
@@ -1152,6 +1152,11 @@
}
}
+ // Type legalization (via getNumberOfParts) can't handle structs
+ if (TLI->getValueType(DL, Src, true) == MVT::Other)
+ return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
+ CostKind);
+
unsigned NumOps =
(Src->isVectorTy() ? getNumVectorRegs(Src) : getNumberOfParts(Src));
diff --git a/llvm/test/Analysis/CostModel/SystemZ/struct-cost-crash.ll b/llvm/test/Analysis/CostModel/SystemZ/struct-cost-crash.ll
new file mode 100644
--- /dev/null
+++ b/llvm/test/Analysis/CostModel/SystemZ/struct-cost-crash.ll
@@ -0,0 +1,25 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 2
+; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output < %s | FileCheck %s
+;
+; Check that SystemZTTIImpl::getMemoryOpCost doesn't try to legalize structs,
+; which was failing llvm_unreachable in MVT::getVT.
+
+target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
+target triple = "s390x-unknown-linux-gnu"
+
+declare { i64, i32 } @bar()
+
+define i8 @foo() {
+; CHECK-LABEL: 'foo'
+; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %1
+; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = call { i64, i32 } @bar()
+; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: store { i64, i32 } %2, ptr inttoptr (i64 16 to ptr), align 16
+; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: br label %1
+;
+ br label %1
+
+1: ; preds = %1, %0
+ %2 = call { i64, i32 } @bar()
+ store { i64, i32 } %2, ptr inttoptr (i64 16 to ptr), align 16
+ br label %1
+}

117
Makefile Normal file
View File

@ -0,0 +1,117 @@
# See ~/.config/mock/<CONFIG>.cfg or /etc/mock/<CONFIG>.cfg
# Tweak this to centos-stream-9-x86_64 to build for CentOS
MOCK_CHROOT?=fedora-rawhide-x86_64
MOCK_OPTS_RELEASE=--no-clean --no-cleanup-after
MOCK_OPTS_SNAPSHOT=$(MOCK_OPTS_RELEASE) --with snapshot_build
YYYYMMDD=$(shell date +%Y%m%d)
SOURCEDIR=$(shell pwd)
SPEC=llvm.spec
FEDPKG_RELEASE=rawhide
######### Get sources
.PHONY: get-sources-snapshot
## Downloads all sources we need for a snapshot build.
get-sources-snapshot:
YYYYMMDD=$(YYYYMMDD) ./.copr/snapshot-info.sh > $(SOURCEDIR)/version.spec.inc
spectool -g --define "_sourcedir $(SOURCEDIR)" --define "_with_snapshot_build 1" $(SPEC)
.PHONY: get-sources-release
## Downloads all sources we need for a release build.
get-sources-release:
spectool -g --define "_sourcedir $(SOURCEDIR)" $(SPEC)
######### Build/Clean SRPM
.PHONY: clean-srpm
## Removes all *.src.rpm (aka SRPMs) from the current directory.
clean-srpm:
rm -fv $(SOURCEDIR)/*.src.rpm
.PHONY: srpm-release
## Builds an SRPM that can be used for a release build.
srpm-release: clean-srpm get-sources-release
fedpkg --release $(FEDPKG_RELEASE) srpm
.PHONY: srpm-snapshot
## Builds an SRPM that can be used for a snapshot build.
srpm-snapshot: clean-srpm get-sources-snapshot
fedpkg --release $(FEDPKG_RELEASE) srpm -- --define "_with_snapshot_build 1"
######### Scrub mock chroot and cache
.PHONY: scrub-chroot
## Completely remove the fedora chroot and cache.
scrub-chroot:
mock -r $(MOCK_CHROOT) --scrub all
######### Do a mock build
.PHONY: mockbuild-release
## Start a mock build of the release SRPM.
mockbuild-release: srpm-release
mock -r $(MOCK_CHROOT) $(MOCK_OPTS_RELEASE) -N *.src.rpm
.PHONY: mockbuild-snapshot
## Start a mock build of the snapshot SRPM.
mockbuild-snapshot: srpm-snapshot
mock -r $(MOCK_CHROOT) $(MOCK_OPTS_SNAPSHOT) -N *.src.rpm
######### Edit-last-failing-script
.PHONY: edit-last-failing-script
## Opens the last failing or running script from mock in your editor
## of choice for you to edit it and later re-run it in mock with:
## "make mockbuild-rerun-last-script-...".
edit-last-failing-script:
$$EDITOR /var/lib/mock/$(MOCK_CHROOT)/root/var/tmp/rpm-tmp.*
######### Re-run the last failing script from mock
######### This is particularly useful when you have
.PHONY: mockbuild-rerun-last-script-release
## Re-runs the last failing or running script of your release mockbuild.
mockbuild-rerun-last-script-release:
mock --root=$(MOCK_CHROOT) $(MOCK_OPTS_RELEASE) --shell 'sh -e /var/tmp/rpm-tmp.*'
.PHONY: mockbuild-rerun-last-script-snapshot
## Re-runs the last failing or running script of your snapshot mockbuild.
## We have multiple flavors of this recipe.
mockbuild-rerun-last-script-snapshot:
mock --root=$(MOCK_CHROOT) $(MOCK_OPTS_SNAPSHOT) --shell 'sh -e /var/tmp/rpm-tmp.*'
.PHONY: help
# Based on https://gist.github.com/rcmachado/af3db315e31383502660
## Display this help text.
help:/
$(info Available targets)
$(info -----------------)
@awk '/^[a-zA-Z\-0-9]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
if (helpMessage) { \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
gsub(/##/, "\n ", helpMessage); \
} else { \
helpMessage = "(No documentation)"; \
} \
printf "%-37s - %s\n", helpCommand, helpMessage; \
lastLine = "" \
} \
{ hasComment = match(lastLine, /^## (.*)/); \
if(hasComment) { \
lastLine=lastLine$$0; \
} \
else { \
lastLine = $$0 \
} \
}' $(MAKEFILE_LIST)
# Map deprecated targets to new targets
.PHONY: snapshot-srpm release-srpm
snapshot-srpm release-srpm:
$(eval mapped_target:=$(subst snapshot-srpm,srpm-snapshot,$(MAKECMDGOALS)))
$(eval mapped_target:=$(subst release-srpm,srpm-release,$(mapped_target)))
$(info WARNING: "$(MAKECMDGOALS)" is deprecated. Instead running "$(mapped_target)")
$(MAKE) $(mapped_target)

View File

@ -15,4 +15,4 @@ addFilter("llvm-libs.x86_64: W: no-soname /usr/lib64/LLVMgold.so")
addFilter("llvm-googletest.x86_64: W: no-documentation") addFilter("llvm-googletest.x86_64: W: no-documentation")
addFilter("llvm-libs.x86_64: W: no-documentation") addFilter("llvm-libs.x86_64: W: no-documentation")
addFilter("llvm-static.x86_64: W: no-documentation") addFilter("llvm-static.x86_64: W: no-documentation")
addFilter("llvm-test.x86_64: W: no-documentation") addFilter("llvm-test.x86_64: W: no-documentation")

2357
llvm.spec

File diff suppressed because it is too large Load Diff

11
macros.clang Normal file
View File

@ -0,0 +1,11 @@
%clang_major_version @@CLANG_MAJOR_VERSION@@
%clang_minor_version @@CLANG_MINOR_VERSION@@
%clang_patch_version @@CLANG_PATCH_VERSION@@
%clang_version %{clang_major_version}.%{clang_minor_version}.%{clang_patch_version}
# This is the path to the clang resource directory that has clang's internal
# headers and libraries. This path should be used by packages that need to
# install files into this directory. This macro's value changes every time
# clang's version changes.
%clang_resource_dir %{_prefix}/lib/clang/%{clang_major_version}

12
sources
View File

@ -1,8 +1,4 @@
SHA512 (cmake-18.1.8.src.tar.xz) = e02243b491f9e688db28d7b53270fcf87debf09d3c95b136a7c7b96e26890de68712c60a1e85f5a448a95ad8c81f2d8ae77047780822443bbe39f1a9e6211007 SHA512 (llvm-project-19.1.3.src.tar.xz) = 0abaf158b373892d5afc184158600df17a0797547ad7238ca9018d6fcdd7310b0db803d158daa82a2e04bd42d9daebaa2c3e4b9024c0fa2df72a88596575df5c
SHA512 (cmake-18.1.8.src.tar.xz.sig) = 99191e95130fe4363a8db8f411a0e61af0549ad182a1280f99f0dd3ee679a321b993d103c6915d535a55d9f8a4d7fea86b7fdcc77605e02150e8edf1e18dee57 SHA512 (llvm-project-19.1.3.src.tar.xz.sig) = 84ef22ee78dbaad4710becbcb02119d06063099f9102bb86f3cd44fbb7e2d87bafe239d8e0cbf22ab5a479f99a11a77125f22394d5006ed86262076ccbf1634d
SHA512 (llvm-18.1.8.src.tar.xz) = 930814730bb2d80cf7f7b2968f0f1f1442009ca62a7ca29992b69d63823270584b059d16aa845bb381411da566e7e4f255fcfbc38acbdf865eb0419b4dfd7459 SHA512 (llvm-project-18.1.8.src.tar.xz) = 25eeee9984c8b4d0fbc240df90f33cbb000d3b0414baff5c8982beafcc5e59e7ef18f6f85d95b3a5f60cb3d4cd4f877c80487b5768bc21bc833f107698ad93db
SHA512 (llvm-18.1.8.src.tar.xz.sig) = aab7cb61a6b5dd3776a9b306d91d08763710725b72ba6a4263d3cca5ae5959e3b073b27dbfd95f9a53a78600c6f414e2fd1cc0dbe3176d7cf142996f7af700ca SHA512 (llvm-project-18.1.8.src.tar.xz.sig) = ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b
SHA512 (third-party-18.1.8.src.tar.xz) = bedaa5d29ebeaf0ee1c700eb8492d0fef185e7c16528202927c81117d94fadd568829aa0e1873e1217e8e72866f3876a9681bbdb2a6a0a5466fc911f7b3620d4
SHA512 (third-party-18.1.8.src.tar.xz.sig) = 32c4d779a56a3908b291a4f0cf1df72ccb86b55439ad66f9cbad1b48a77cb92b129b131806d2914d0e63cb319cde3181a2c03b75856ec36cee5f88120bb58214
SHA512 (llvm-17.0.6.src.tar.xz) = bf9b04d0d45c67168b195c550cd8326e3a01176f92776705846aad3956a494bcb7a053b0b0bde19abd68dc0068e5c97ef99dee7eadfdb727bc0d758b2684f3bd
SHA512 (llvm-17.0.6.src.tar.xz.sig) = 904066c34ec0adf5b9e789af640329cadc7919b111aca77fa3ce26450696bace20e299e2592251f96ee33fb83da603423cc0ca63a67ad627916fcab0bed59689

View File

@ -1,6 +1,15 @@
# Gating testplans for LLVM # Gating testplans for LLVM
The tests for LLVM are in a separate repo: https://src.fedoraproject.org/tests/llvm The tests for LLVM are in separate repos:
* llvm: https://src.fedoraproject.org/tests/llvm.git/
* clang: https://src.fedoraproject.org/tests/clang.git/
* compiler-rt: https://src.fedoraproject.org/tests/compiler-rt.git/
* libomp: https://src.fedoraproject.org/tests/libomp.git/
* python-lit: https://src.fedoraproject.org/tests/python-lit.git/
* lld: https://src.fedoraproject.org/tests/lld.git/
* lldb: https://src.fedoraproject.org/tests/lldb.git/
This directory should contain only fmf plans (such as build-gating.fmf) which import This directory should contain only fmf plans (such as build-gating.fmf) which import
the tests from the tests repo. This can be done using the "url" parameter of the the tests from the tests repo. This can be done using the "url" parameter of the
plan's "discover" step. Reference: https://tmt.readthedocs.io/en/stable/spec/plans.html#fmf plan's "discover" step. Reference: https://tmt.readthedocs.io/en/stable/spec/plans.html#fmf

View File

@ -1,16 +1,17 @@
# #
# Build/PR gating tests for *LLVM 13* # Build/PR gating tests for *LLVM 19*
# #
# Imports and runs tests provided by Fedora LLVM git for the matching LLVM version. # Compatible with various LLVM 19 distributions:
# #
# NOTE: *always* keep this file in sync with upstream, i.e. Fedora. Since we cannot "discover" a plan, # * Fedora (ursine packages)
# we must duplicate at least some part of upstream plan setup, like `adjust` or `provision`. Not necessarily # * CentOS 10 stream (ursine packages)
# all steps, btu if we do need some of them here, let's focus on making changes in upstream first, to preserve # * Centos 9 stream (ursine packages)
# one source of truth. Once TMT learns to include whole plans, we could drop the copied content from here. # * RHEL-10 (ursine packages)
# * RHEL-9 (ursine packages)
# * RHEL-8 (Red Hat module)
# #
summary: LLVM tests for build/PR gating summary: LLVM tests for build/PR gating
adjust: adjust:
- because: "Plan to be ran when either executed locally, or executed by CI system to gate a build or PR." - because: "Plan to be ran when either executed locally, or executed by CI system to gate a build or PR."
when: >- when: >-
@ -19,33 +20,72 @@ adjust:
and trigger != build and trigger != build
enabled: false enabled: false
# Unfortunately, TMT does not support more declarative approach, we need to run commands on our own. - because: "When testing SCL-ized LLVM, the collection must be enabled first"
- because: "On RHEL, CRB must be enabled to provide rarer packages" environment+:
when: >- WITH_SCL: "scl enable llvm-toolset-13.0 rust-toolset-1.58"
distro == rhel-9 when: "collection == llvm-toolset-13.0"
or distro == rhel-8 - because: "When testing SCL-ized LLVM, the collection must be enabled first"
prepare+: environment+:
- name: Enable CRB WITH_SCL: "scl enable llvm-toolset-14.0 rust-toolset-1.62"
how: shell when: "collection == llvm-toolset-14.0"
script: dnf config-manager --set-enabled rhel-CRB
# Unfortunatelly, TMT does not support more declarative approach, we need to run commands on our own.
- because: "On CentOS, CRB must be enabled to provide rarer packages" - because: "On CentOS, CRB must be enabled to provide rarer packages"
when: >-
distro == centos
prepare+: prepare+:
- name: Enable CRB - name: Enable CRB
how: shell how: shell
script: dnf config-manager --set-enabled crb script: dnf config-manager --set-enabled crb
when: >-
distro == centos
# Unfortunately, TMT does not support more declarative approach, we need to run commands on our own.
- because: "On RHEL, CRB must be enabled to provide rarer packages"
prepare+:
- name: Enable CRB
how: shell
script: dnf config-manager --set-enabled rhel-CRB
when: >-
distro == rhel-9
or distro == rhel-8
discover: discover:
- name: "Upstream LLVM tests for build/PR gating" - name: llvm-tests
how: fmf how: fmf
url: https://src.fedoraproject.org/tests/llvm.git url: https://src.fedoraproject.org/tests/llvm.git
ref: main ref: main
filter: "tag:-spoils-installation" filter: "tag:-spoils-installation & tag:-not-in-default"
- name: clang-tests
how: fmf
url: https://src.fedoraproject.org/tests/clang.git
ref: main
filter: "tag:-spoils-installation & tag:-not-in-default"
- name: compiler-rt-tests
how: fmf
url: https://src.fedoraproject.org/tests/compiler-rt.git
ref: main
filter: "tag:-spoils-installation & tag:-not-in-default"
- name: libomp-tests
how: fmf
url: https://src.fedoraproject.org/tests/libomp.git
ref: main
filter: "tag:-spoils-installation & tag:-not-in-default"
- name: python-lit
how: fmf
url: https://src.fedoraproject.org/tests/python-lit.git
ref: main
filter: "tag:-spoils-installation & tag:-not-in-default"
- name: lld-tests
how: fmf
url: https://src.fedoraproject.org/tests/lld.git
ref: main
filter: "tag:-spoils-installation & tag:-not-in-default"
- name: lldb-tests
how: fmf
url: https://src.fedoraproject.org/tests/lldb.git
ref: main
filter: "tag:-spoils-installation & tag:-not-in-default"
execute: execute:
how: tmt how: tmt
provision: provision:
hardware: hardware:
memory: ">= 4 GiB" memory: ">= 4 GiB"

View File

@ -0,0 +1,23 @@
summary: Build latest kernel-ark with clang using different build configurations
discover:
how: fmf
url: https://src.fedoraproject.org/tests/clang.git
ref: main
test: kernel-ark-build
execute:
how: tmt
provision:
hardware:
memory: ">=16 GiB"
cpu:
cores: ">=8"
adjust:
- because: "Plan to be ran when either executed locally, or executed by CI system to gate a build or PR."
when: >-
trigger is defined
and trigger != commit
and trigger != build
enabled: false
- because: "Rebuilding kernel-ark is relevant only to rawhide"
when: distro is not defined or distro != fedora-rawhide
enabled: false

View File

@ -0,0 +1,20 @@
summary: LLD tests for build/PR gating, testing alternatives and spoiling the installation
adjust:
- because: "Plan to be ran when either executed locally, or executed by CI system to gate a build or PR."
when: >-
trigger is defined
and trigger != commit
and trigger != build
enabled: false
discover:
- name: lld-tests
how: fmf
url: https://src.fedoraproject.org/tests/lld.git
ref: main
test: ld-alternative
execute:
how: tmt
provision:
hardware:
memory: ">= 4 GiB"