llvm: update to 17.0.4 - Part1
This commit is contained in:
@@ -1,75 +0,0 @@
|
||||
From cef120a2e5abba06c1d7a699a4fd4a17e488d6af Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
|
||||
Date: Sun, 1 Oct 2023 00:08:23 +0300
|
||||
Subject: [PATCH] [AArch64] Disable loop alignment for Windows targets
|
||||
|
||||
This should fix #66912. When emitting SEH unwind info, we need to
|
||||
be able to calculate the exact length of functions before alignments
|
||||
are fixed. Until that limitation is overcome, just disable all
|
||||
loop alignment on Windows targets.
|
||||
---
|
||||
llvm/lib/MC/MCWin64EH.cpp | 3 +++
|
||||
.../Target/AArch64/AArch64ISelLowering.cpp | 7 ++++++-
|
||||
llvm/test/CodeGen/AArch64/sched-loop-align.ll | 21 +++++++++++++++++++
|
||||
3 files changed, 30 insertions(+), 1 deletion(-)
|
||||
create mode 100644 llvm/test/CodeGen/AArch64/sched-loop-align.ll
|
||||
|
||||
diff --git a/lib/MC/MCWin64EH.cpp b/lib/MC/MCWin64EH.cpp
|
||||
index a2d61da722af870..bb3492bec8aad8a 100644
|
||||
--- a/lib/MC/MCWin64EH.cpp
|
||||
+++ b/lib/MC/MCWin64EH.cpp
|
||||
@@ -1402,6 +1402,9 @@ static void ARM64EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info,
|
||||
// here, but we'd have to emit the pdata, the xdata header, and the
|
||||
// epilogue scopes later, since they depend on whether the we need to
|
||||
// split the unwind data.
|
||||
+ //
|
||||
+ // If this is fixed, remove code in AArch64ISelLowering.cpp that
|
||||
+ // disables loop alignment on Windows.
|
||||
RawFuncLength = GetAbsDifference(streamer, info->FuncletOrFuncEnd,
|
||||
info->Begin);
|
||||
}
|
||||
diff --git a/lib/Target/AArch64/AArch64ISelLowering.cpp b/lib/Target/AArch64/AArch64ISelLowering.cpp
|
||||
index 932b36587f0694e..46064bc7e46783f 100644
|
||||
--- a/lib/Target/AArch64/AArch64ISelLowering.cpp
|
||||
+++ b/lib/Target/AArch64/AArch64ISelLowering.cpp
|
||||
@@ -1051,7 +1051,12 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
|
||||
// Set required alignment.
|
||||
setMinFunctionAlignment(Align(4));
|
||||
// Set preferred alignments.
|
||||
- setPrefLoopAlignment(STI.getPrefLoopAlignment());
|
||||
+
|
||||
+ // Don't align loops on Windows. The SEH unwind info generation needs to
|
||||
+ // know the exact length of functions before the alignments have been
|
||||
+ // expanded.
|
||||
+ if (!Subtarget->isTargetWindows())
|
||||
+ setPrefLoopAlignment(STI.getPrefLoopAlignment());
|
||||
setMaxBytesForAlignment(STI.getMaxBytesForLoopAlignment());
|
||||
setPrefFunctionAlignment(STI.getPrefFunctionAlignment());
|
||||
|
||||
diff --git a/test/CodeGen/AArch64/sched-loop-align.ll b/test/CodeGen/AArch64/sched-loop-align.ll
|
||||
new file mode 100644
|
||||
index 000000000000000..5b8e42c2790a439
|
||||
--- /dev/null
|
||||
+++ b/test/CodeGen/AArch64/sched-loop-align.ll
|
||||
@@ -0,0 +1,21 @@
|
||||
+; RUN: llc < %s -mtriple=aarch64-windows | FileCheck %s --check-prefix=WINDOWS
|
||||
+; RUN: llc < %s -mtriple=aarch64-linux | FileCheck %s --check-prefix=LINUX
|
||||
+
|
||||
+define dso_local void @b() #0 {
|
||||
+entry:
|
||||
+ br label %for.cond
|
||||
+
|
||||
+for.cond:
|
||||
+ tail call void @a()
|
||||
+ br label %for.cond
|
||||
+}
|
||||
+
|
||||
+declare dso_local void @a(...)
|
||||
+
|
||||
+attributes #0 = { noreturn nounwind uwtable "tune-cpu"="cortex-a53" }
|
||||
+
|
||||
+; LINUX-LABEL: b:
|
||||
+; LINUX: .p2align 4
|
||||
+
|
||||
+; WINDOWS-LABEL: b:
|
||||
+; WINDOWS-NOT: .p2align
|
||||
@@ -23,11 +23,11 @@ pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
|
||||
"${MINGW_PACKAGE_PREFIX}-lld"
|
||||
"${MINGW_PACKAGE_PREFIX}-llvm"
|
||||
"${MINGW_PACKAGE_PREFIX}-llvm-libs")
|
||||
_version=17.0.2
|
||||
_version=17.0.4
|
||||
_rc=
|
||||
_tag=llvmorg-${_version}${_rc}
|
||||
pkgver=${_version}${_rc/-/}
|
||||
pkgrel=2
|
||||
pkgrel=1
|
||||
pkgdesc="C language family frontend for LLVM (mingw-w64)"
|
||||
arch=('any')
|
||||
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
|
||||
@@ -62,7 +62,6 @@ source=("${_url}/llvm-${pkgver}.src.tar.xz"{,.sig}
|
||||
"0002-Fix-Findzstd-on-MINGW.patch"
|
||||
"0003-add-pthread-as-system-lib-for-mingw.patch"
|
||||
"0004-enable-emutls-for-mingw.patch"
|
||||
"0005-aarch64-unwind-seh.patch"
|
||||
"0101-link-pthread-with-mingw.patch"
|
||||
"0102-Rename-flang-new-flang-experimental-exec-to-flang.patch"
|
||||
"0303-ignore-new-bfd-options.patch")
|
||||
@@ -72,25 +71,24 @@ source=("${_url}/llvm-${pkgver}.src.tar.xz"{,.sig}
|
||||
#0201-0299 -> rt
|
||||
#0301-0399 -> lld
|
||||
#0401-0499 -> clang-tools-extra
|
||||
sha256sums=('61dd9eaa1f874a10a51dc397b84998eaebdd3c55a5a5fa6c24b2081a435b47c6'
|
||||
sha256sums=('4f5907fb547947d10df35230a0fc73cf2f81aa12e09fc8de96c023425412c9f6'
|
||||
'SKIP'
|
||||
'ce1c16b766894b3281038e4b2c4280f1b8c42fd5cc95ba355bba0f5ff47e23fa'
|
||||
'56c99515be2f245848dacc60fe85fe9de66cdc438ea0a1b82640e68384d0e432'
|
||||
'SKIP'
|
||||
'7ed1dd0c2f8a37f5759d9a7954655f7fcad933cba9bdb6ea30f592b47cac4e44'
|
||||
'e191d573cbf0ec15ce12c8ac7080d3a1eeb27b8296ee104e1147cae90f424211'
|
||||
'SKIP'
|
||||
'8053f53d3205f9758b03784c5d0cf8235ffe2f3fb7a946aea9c6aa5ff9b8d1a1'
|
||||
'9dd56f359f3dc08fb1dd34f4e3147e5a84b4f0d96a39160c8eb739cf7ea32e64'
|
||||
'SKIP'
|
||||
'ccd46707b349f0e2bd8fe9eeb0ac5aa2ab1366a4939957dadab25dec14c68036'
|
||||
'47f5da4d28c60d69ab134c028ece0af8a5e18aca940d26a672265a381cafdc50'
|
||||
'SKIP'
|
||||
'07093ef3b47bc30c24c8ab4996dea8c89eb6f3c8f55cd43158000c61c1fd5075'
|
||||
'1a5cbe4a1fcda56ecdd80f42c3437060a28c97ec31de1748f6ba6aa84948fb0f'
|
||||
'SKIP'
|
||||
'058623c5859c99e6b6711e88c646e80778377ec8e596e1f0e24efb987e063aff'
|
||||
'49358a7da2f49149a3028bf3aa6389052d4ebc15c548699cf19694141fdea847'
|
||||
'SKIP'
|
||||
'eb03df53671df6627768141b3aaa76abe176a14e5e47911c97bec544387c4aff'
|
||||
'd7d58ad5d0e77f2803070a8fb7f4138a6f49a2cbf30c55ff059c31f40ca6b65c'
|
||||
'7f0c64cd87b61e894be632f180ae5291e1aa9f1d9d382608f659067eeeda7146'
|
||||
'5f86e542dd1ec92b2fe06ee59061c3e23512df7bafabe82206f2b7d80b81836b'
|
||||
'23b92a36f1623c3bd03fac831457597fc28276b9fd442cff6c962500e8cbbbc4'
|
||||
'715cb8862753854b2d9256e0b70003e2d1f57083d83eaeaf5a095fc72b8a4e26'
|
||||
'2770cadf8ccf6b31aece6aee8f76dceb71e6e9d01fdf3be74c3743480ce34899'
|
||||
'de631ab199a6fe83b3f695350bffaad067a2f95fc2ba9c8fe57dc85665d3653c')
|
||||
@@ -129,8 +127,7 @@ prepare() {
|
||||
cd "${srcdir}/llvm"
|
||||
apply_patch_with_msg \
|
||||
"0001-Fix-GetHostTriple-for-mingw-w64-in-msys.patch" \
|
||||
"0002-Fix-Findzstd-on-MINGW.patch" \
|
||||
"0005-aarch64-unwind-seh.patch"
|
||||
"0002-Fix-Findzstd-on-MINGW.patch"
|
||||
|
||||
if (( ! _clangprefix )); then
|
||||
apply_patch_with_msg \
|
||||
|
||||
@@ -8,7 +8,7 @@ _realname=libc++
|
||||
pkgbase=mingw-w64-${_realname}
|
||||
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
|
||||
"${MINGW_PACKAGE_PREFIX}-libunwind")
|
||||
_version=17.0.2
|
||||
_version=17.0.4
|
||||
_rc=
|
||||
_tag=llvmorg-${_version}${_rc}
|
||||
pkgver=${_version}${_rc/-/}
|
||||
@@ -38,15 +38,15 @@ source=("${_url}/libcxx-${pkgver}.src.tar.xz"{,.sig}
|
||||
"https://raw.githubusercontent.com/llvm/llvm-project/${_tag}/runtimes/Components.cmake.in"
|
||||
"https://raw.githubusercontent.com/llvm/llvm-project/${_tag}/runtimes/cmake/Modules/HandleFlags.cmake"
|
||||
"https://raw.githubusercontent.com/llvm/llvm-project/${_tag}/runtimes/cmake/Modules/WarningFlags.cmake")
|
||||
sha256sums=('fe2b1c816ff4cbc06c89174c4e91cb98d85e6dc1cf09ecaaabf9bebe71a7ffc9'
|
||||
sha256sums=('339f423355ac8089e5db693454145b4661ac1594269e51e661f1d244ccb49567'
|
||||
'SKIP'
|
||||
'bbf71a2aeece988299b9ab84d9b1f283cfdf954ee3b7cfc0efafbd4ef37446b2'
|
||||
'758a4b833080e3306f064e5e44355c2d57bd1c56b1b340d8acb08c179d61044e'
|
||||
'SKIP'
|
||||
'252663ff79d67ba0c7832c1e13311fc42ffb561e2281195237718953987d66d7'
|
||||
'77414d001c3b309ddf0f200a25e53d2de297d8de00608c28314905f35aacb44f'
|
||||
'SKIP'
|
||||
'61dd9eaa1f874a10a51dc397b84998eaebdd3c55a5a5fa6c24b2081a435b47c6'
|
||||
'4f5907fb547947d10df35230a0fc73cf2f81aa12e09fc8de96c023425412c9f6'
|
||||
'SKIP'
|
||||
'07093ef3b47bc30c24c8ab4996dea8c89eb6f3c8f55cd43158000c61c1fd5075'
|
||||
'1a5cbe4a1fcda56ecdd80f42c3437060a28c97ec31de1748f6ba6aa84948fb0f'
|
||||
'SKIP'
|
||||
'9287553565f2ede6a7b8f392b275e437f644d16c8e01ec6a5ce708ad61bccd15'
|
||||
'bc0974b6555874d3c24295fe8b99b25aea8086158ee4ab87e9a8709191cc7824'
|
||||
|
||||
Reference in New Issue
Block a user