[flang-commits] [flang] [llvm] [Premerge] Add flang-rt (PR #128678)
Michael Kruse via flang-commits
flang-commits at lists.llvm.org
Wed Mar 5 07:33:21 PST 2025
https://github.com/Meinersbur updated https://github.com/llvm/llvm-project/pull/128678
>From 9ebeeae4f8e57b80cbe7a680ba791a4b315e27ca Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Tue, 25 Feb 2025 09:31:07 +0100
Subject: [PATCH 1/9] [Premerge] Add flang-rt
---
.ci/compute-projects.sh | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/.ci/compute-projects.sh b/.ci/compute-projects.sh
index 32baf26b4f0a0..804883f3b7b8b 100644
--- a/.ci/compute-projects.sh
+++ b/.ci/compute-projects.sh
@@ -32,6 +32,7 @@ function compute-projects-to-test() {
# Flang is not stable in Windows CI at the moment
if [[ $isForWindows == 0 ]]; then
echo flang
+ echo flang-rt
fi
;;
clang)
@@ -47,6 +48,7 @@ function compute-projects-to-test() {
# Flang is not stable in Windows CI at the moment
if [[ $isForWindows == 0 ]]; then
echo flang
+ echo flang-rt
fi
;;
*)
@@ -95,11 +97,16 @@ function add-dependencies() {
compiler-rt|libc|openmp)
echo clang lld
;;
- flang|lldb|libclc)
+ lldb|libclc)
for p in llvm clang; do
echo $p
done
;;
+ flang)
+ for p in llvm clang mlir flang-rt; do
+ echo $p
+ done
+ ;;
lld|mlir|polly)
echo llvm
;;
>From afada274c131de7961076462737b7bdb284647cd Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Fri, 28 Feb 2025 13:27:46 +0100
Subject: [PATCH 2/9] Don't change deps
---
.ci/compute-projects.sh | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/.ci/compute-projects.sh b/.ci/compute-projects.sh
index 804883f3b7b8b..51fcf54dd81af 100644
--- a/.ci/compute-projects.sh
+++ b/.ci/compute-projects.sh
@@ -97,16 +97,11 @@ function add-dependencies() {
compiler-rt|libc|openmp)
echo clang lld
;;
- lldb|libclc)
+ flang|lldb|libclc)
for p in llvm clang; do
echo $p
done
;;
- flang)
- for p in llvm clang mlir flang-rt; do
- echo $p
- done
- ;;
lld|mlir|polly)
echo llvm
;;
>From 8345c19d06b971fccf95f2cf3ddca9431dd0f935 Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Fri, 28 Feb 2025 13:52:41 +0100
Subject: [PATCH 3/9] flang-rt has dependencies
---
.ci/compute-projects.sh | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/.ci/compute-projects.sh b/.ci/compute-projects.sh
index 51fcf54dd81af..caee831a2c738 100644
--- a/.ci/compute-projects.sh
+++ b/.ci/compute-projects.sh
@@ -97,11 +97,21 @@ function add-dependencies() {
compiler-rt|libc|openmp)
echo clang lld
;;
- flang|lldb|libclc)
+ lldb|libclc)
for p in llvm clang; do
echo $p
done
;;
+ flang)
+ for p in llvm clang mlir; do
+ echo $p
+ done
+ ;;
+ flang-rt)
+ for p in llvm clang mlir flang; do
+ echo $p
+ done
+ ;;
lld|mlir|polly)
echo llvm
;;
>From da2a5394212b461a67c3e343818a6ff10f196900 Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Tue, 4 Mar 2025 00:20:34 +0100
Subject: [PATCH 4/9] flang-rt is a runtime
---
.ci/compute-projects.sh | 6 ++++--
.ci/generate-buildkite-pipeline-premerge | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/.ci/compute-projects.sh b/.ci/compute-projects.sh
index 51fcf54dd81af..2cfd330b00f5d 100644
--- a/.ci/compute-projects.sh
+++ b/.ci/compute-projects.sh
@@ -32,7 +32,6 @@ function compute-projects-to-test() {
# Flang is not stable in Windows CI at the moment
if [[ $isForWindows == 0 ]]; then
echo flang
- echo flang-rt
fi
;;
clang)
@@ -48,7 +47,6 @@ function compute-projects-to-test() {
# Flang is not stable in Windows CI at the moment
if [[ $isForWindows == 0 ]]; then
echo flang
- echo flang-rt
fi
;;
*)
@@ -67,6 +65,10 @@ function compute-runtimes-to-test() {
echo $p
done
;;
+ flang)
+ for p in flang-rt; do
+ echo $p
+ done
*)
# Nothing to do
;;
diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge
index e547afaeb722f..b0b0d60a8a138 100755
--- a/.ci/generate-buildkite-pipeline-premerge
+++ b/.ci/generate-buildkite-pipeline-premerge
@@ -73,7 +73,7 @@ fi
# needs while letting them run on the infrastructure provided by LLVM.
# Figure out which projects need to be built on each platform
-all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl"
+all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang flang-rt libc libclc lld lldb llvm mlir openmp polly pstl"
modified_projects="$(keep-modified-projects ${all_projects})"
linux_projects_to_test=$(exclude-linux $(compute-projects-to-test 0 ${modified_projects}))
>From a8a932310b4a562689f7a21ae6bcb9bfb57ce07a Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Tue, 4 Mar 2025 12:46:57 +0100
Subject: [PATCH 5/9] Fix syntax error
---
.ci/compute-projects.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/.ci/compute-projects.sh b/.ci/compute-projects.sh
index 026d0bb3a7cfb..088e75e72303d 100644
--- a/.ci/compute-projects.sh
+++ b/.ci/compute-projects.sh
@@ -69,6 +69,7 @@ function compute-runtimes-to-test() {
for p in flang-rt; do
echo $p
done
+ ;;
*)
# Nothing to do
;;
>From a7b728cc33a14a48da8cbb27866f78948d547b99 Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Tue, 4 Mar 2025 13:11:37 +0100
Subject: [PATCH 6/9] flang_runtime_amdgpu-offload
---
offload/cmake/caches/AMDGPUBot.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/offload/cmake/caches/AMDGPUBot.cmake b/offload/cmake/caches/AMDGPUBot.cmake
index 521841166be82..0236f5f0b6987 100644
--- a/offload/cmake/caches/AMDGPUBot.cmake
+++ b/offload/cmake/caches/AMDGPUBot.cmake
@@ -10,7 +10,7 @@ set(CMAKE_C_COMPILER_LAUNCHER ccache CACHE STRING "")
set(CMAKE_CXX_COMPILER_LAUNCHER ccache CACHE STRING "")
set(LLVM_ENABLE_PROJECTS "clang;lld;mlir;flang" CACHE STRING "")
-set(LLVM_ENABLE_RUNTIMES "compiler-rt;openmp;offload" CACHE STRING "")
+set(LLVM_ENABLE_RUNTIMES "compiler-rt;openmp;offload;flang-rt" CACHE STRING "")
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
>From b0d0879ccecee3553479774f009a210a9939c8e7 Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Wed, 5 Mar 2025 12:40:41 +0100
Subject: [PATCH 7/9] Pass Flang as Fortran compiler
---
.ci/monolithic-linux.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh
index 55741bc831046..101aa1507ed12 100755
--- a/.ci/monolithic-linux.sh
+++ b/.ci/monolithic-linux.sh
@@ -82,9 +82,9 @@ if [[ "${runtimes}" != "" ]]; then
exit 1
fi
- echo "--- ninja install-clang"
+ echo "--- ninja install-clang install-flang"
- ninja -C ${BUILD_DIR} install-clang install-clang-resource-headers
+ ninja -C ${BUILD_DIR} install-clang install-flang install-clang-resource-headers
RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes"
INSTALL_DIR="${BUILD_DIR}/install"
@@ -95,6 +95,8 @@ if [[ "${runtimes}" != "" ]]; then
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
+ -D CMAKE_Fortran_COMPILER="${INSTALL_DIR}/bin/flang" \
+ -D CMAKE_Fortran_COMPILER_WORKS=ON \
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
-D LIBCXX_CXX_ABI=libcxxabi \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
>From e8b028a64a86964efafc3e1b8575ee997ea033df Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Wed, 5 Mar 2025 15:27:10 +0100
Subject: [PATCH 8/9] Minimal changes
---
.ci/compute-projects.sh | 12 +-----------
.ci/generate-buildkite-pipeline-premerge | 2 +-
.ci/monolithic-linux.sh | 6 +++---
3 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/.ci/compute-projects.sh b/.ci/compute-projects.sh
index 088e75e72303d..c76aa33848a36 100644
--- a/.ci/compute-projects.sh
+++ b/.ci/compute-projects.sh
@@ -100,21 +100,11 @@ function add-dependencies() {
compiler-rt|libc|openmp)
echo clang lld
;;
- lldb|libclc)
+ flang|lldb|libclc)
for p in llvm clang; do
echo $p
done
;;
- flang)
- for p in llvm clang mlir; do
- echo $p
- done
- ;;
- flang-rt)
- for p in llvm clang mlir flang; do
- echo $p
- done
- ;;
lld|mlir|polly)
echo llvm
;;
diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge
index b0b0d60a8a138..e547afaeb722f 100755
--- a/.ci/generate-buildkite-pipeline-premerge
+++ b/.ci/generate-buildkite-pipeline-premerge
@@ -73,7 +73,7 @@ fi
# needs while letting them run on the infrastructure provided by LLVM.
# Figure out which projects need to be built on each platform
-all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang flang-rt libc libclc lld lldb llvm mlir openmp polly pstl"
+all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl"
modified_projects="$(keep-modified-projects ${all_projects})"
linux_projects_to_test=$(exclude-linux $(compute-projects-to-test 0 ${modified_projects}))
diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh
index 101aa1507ed12..58906d32fe7c7 100755
--- a/.ci/monolithic-linux.sh
+++ b/.ci/monolithic-linux.sh
@@ -82,9 +82,9 @@ if [[ "${runtimes}" != "" ]]; then
exit 1
fi
- echo "--- ninja install-clang install-flang"
+ echo "--- ninja install-clang"
- ninja -C ${BUILD_DIR} install-clang install-flang install-clang-resource-headers
+ ninja -C ${BUILD_DIR} install-clang install-clang-resource-headers
RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes"
INSTALL_DIR="${BUILD_DIR}/install"
@@ -95,7 +95,7 @@ if [[ "${runtimes}" != "" ]]; then
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
- -D CMAKE_Fortran_COMPILER="${INSTALL_DIR}/bin/flang" \
+ -D CMAKE_Fortran_COMPILER="${BUILD_DIR}/bin/flang" \
-D CMAKE_Fortran_COMPILER_WORKS=ON \
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
-D LIBCXX_CXX_ABI=libcxxabi \
>From 67809ce5d46bc2482bdf88771d418ad6f6916cbc Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Wed, 5 Mar 2025 16:33:03 +0100
Subject: [PATCH 9/9] Add change in flang/ to trigger pre-merge check
---
flang/docs/F202X.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/flang/docs/F202X.md b/flang/docs/F202X.md
index c6b5c5926efcc..67ea7fd97449a 100644
--- a/flang/docs/F202X.md
+++ b/flang/docs/F202X.md
@@ -291,7 +291,7 @@ functions whose implementations have very low priority: `SPLIT` and `TOKENIZE`.
and could and should have been implemented once in some Fortran utility
library for those who need a slow tokenization facility rather than
requiring implementations in each vendor's runtime support library with
-all the extra cost and compatibilty risk that entails.
+all the extra cost and compatibility risk that entails.
`SPLIT` is worse -- not only could it, like `TOKENIZE`,
have been supplied by a Fortran utility library rather than being
More information about the flang-commits
mailing list