10.0.0 rc1

This commit is contained in:
serge-sans-paille 2020-02-04 10:49:30 +00:00
parent 13fa3366b4
commit 7790ff0825
8 changed files with 69 additions and 2735 deletions

2
.gitignore vendored
View file

@ -54,3 +54,5 @@
/llvm-9.0.0rc3.src.tar.xz
/llvm-9.0.0.src.tar.xz
/llvm-9.0.1.src.tar.xz
/llvm-10.0.0rc1.src.tar.xz
/llvm-10.0.0rc1.src.tar.xz.sig

View file

@ -1,42 +0,0 @@
From 29b4d8f19e30910c099c5453da258843d6b7869a Mon Sep 17 00:00:00 2001
From: serge_sans_paille <sguelton@redhat.com>
Date: Tue, 24 Sep 2019 10:20:08 +0200
Subject: [PATCH] [AVR] Fix endianness handling in AVR MC
Differential Revision: https://reviews.llvm.org/D67926
---
llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp b/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp
index bc048877868..db995e24756 100644
--- a/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp
+++ b/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp
@@ -25,6 +25,7 @@
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/Support/Casting.h"
+#include "llvm/Support/EndianStream.h"
#include "llvm/Support/raw_ostream.h"
#define DEBUG_TYPE "mccodeemitter"
@@ -268,14 +269,11 @@ unsigned AVRMCCodeEmitter::getMachineOpValue(const MCInst &MI,
void AVRMCCodeEmitter::emitInstruction(uint64_t Val, unsigned Size,
const MCSubtargetInfo &STI,
raw_ostream &OS) const {
- const uint16_t *Words = reinterpret_cast<uint16_t const *>(&Val);
size_t WordCount = Size / 2;
for (int64_t i = WordCount - 1; i >= 0; --i) {
- uint16_t Word = Words[i];
-
- OS << (uint8_t) ((Word & 0x00ff) >> 0);
- OS << (uint8_t) ((Word & 0xff00) >> 8);
+ uint16_t Word = (Val >> (i * 16)) & 0xFFFF;
+ support::endian::write(OS, Word, support::endianness::little);
}
}
--
2.20.1

File diff suppressed because it is too large Load diff

View file

@ -1,138 +0,0 @@
From f2ccdd2700174c717dc55a0f4c3f5a91ae73ff42 Mon Sep 17 00:00:00 2001
From: Yonghong Song <yhs@fb.com>
Date: Fri, 2 Aug 2019 21:28:28 +0000
Subject: [PATCH] [BPF] annotate DIType metadata for builtin
preseve_array_access_index()
Previously, debuginfo types are annotated to
IR builtin preserve_struct_access_index() and
preserve_union_access_index(), but not
preserve_array_access_index(). The debug info
is useful to identify the root type name which
later will be used for type comparison.
For user access without explicit type conversions,
the previous scheme works as we can ignore intermediate
compiler generated type conversions (e.g., from union types to
union members) and still generate correct access index string.
The issue comes with user explicit type conversions, e.g.,
converting an array to a structure like below:
struct t { int a; char b[40]; };
struct p { int c; int d; };
struct t *var = ...;
... __builtin_preserve_access_index(&(((struct p *)&(var->b[0]))->d)) ...
Although BPF backend can derive the type of &(var->b[0]),
explicit type annotation make checking more consistent
and less error prone.
Another benefit is for multiple dimension array handling.
For example,
struct p { int c; int d; } g[8][9][10];
... __builtin_preserve_access_index(&g[2][3][4].d) ...
It would be possible to calculate the number of "struct p"'s
before accessing its member "d" if array debug info is
available as it contains each dimension range.
This patch enables to annotate IR builtin preserve_array_access_index()
with proper debuginfo type. The unit test case and language reference
is updated as well.
Signed-off-by: Yonghong Song <yhs@fb.com>
Differential Revision: https://reviews.llvm.org/D65664
llvm-svn: 367724
(cherry picked from commit d0ea05d5eff475a27a5d3bbe4d9fd389935f9cb2)
Also added back
Value *CreatePreserveArrayAccessIndex(Value *Base, unsigned Dimension,
unsigned LastIndex);
To avoid breaking the ABI.
---
clang/lib/CodeGen/CGExpr.cpp | 12 ++++++++---
.../CodeGen/builtin-preserve-access-index-array.c | 18 +++++++++++++++++
clang/test/CodeGen/builtin-preserve-access-index.c | 23 +++++++++++-----------
llvm/docs/LangRef.rst | 4 ++++
llvm/include/llvm/IR/IRBuilder.h | 13 ++++++++++--
llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll | 2 +-
6 files changed, 55 insertions(+), 17 deletions(-)
create mode 100644 clang/test/CodeGen/builtin-preserve-access-index-array.c
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 87e8a55..b63e3af 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -17349,6 +17349,10 @@ based on array base ``base``, array dimension ``dim`` and the last access index
into the array. The return type ``ret_type`` is a pointer type to the array element.
The array ``dim`` and ``index`` are preserved which is more robust than
getelementptr instruction which may be subject to compiler transformation.
+The ``llvm.preserve.access.index`` type of metadata is attached to this call instruction
+to provide array or pointer debuginfo type.
+The metadata is a ``DICompositeType`` or ``DIDerivedType`` representing the
+debuginfo version of ``type``.
Arguments:
""""""""""
diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index a74364d..c2fa9a3 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -2455,6 +2455,11 @@ public:
Value *CreatePreserveArrayAccessIndex(Value *Base, unsigned Dimension,
unsigned LastIndex) {
+ return CreatePreserveArrayAccessIndex(Base, Dimension, LastIndex, nullptr);
+ }
+
+ Value *CreatePreserveArrayAccessIndex(Value *Base, unsigned Dimension,
+ unsigned LastIndex, MDNode *DbgInfo) {
assert(isa<PointerType>(Base->getType()) &&
"Invalid Base ptr type for preserve.array.access.index.");
auto *BaseType = Base->getType();
@@ -2476,6 +2481,8 @@ public:
Value *DimV = getInt32(Dimension);
CallInst *Fn =
CreateCall(FnPreserveArrayAccessIndex, {Base, DimV, LastIndexV});
+ if (DbgInfo)
+ Fn->setMetadata(LLVMContext::MD_preserve_access_index, DbgInfo);
return Fn;
}
@@ -2493,7 +2500,8 @@ public:
Value *DIIndex = getInt32(FieldIndex);
CallInst *Fn =
CreateCall(FnPreserveUnionAccessIndex, {Base, DIIndex});
- Fn->setMetadata(LLVMContext::MD_preserve_access_index, DbgInfo);
+ if (DbgInfo)
+ Fn->setMetadata(LLVMContext::MD_preserve_access_index, DbgInfo);
return Fn;
}
@@ -2516,7 +2524,8 @@ public:
Value *DIIndex = getInt32(FieldIndex);
CallInst *Fn = CreateCall(FnPreserveStructAccessIndex,
{Base, GEPIndex, DIIndex});
- Fn->setMetadata(LLVMContext::MD_preserve_access_index, DbgInfo);
+ if (DbgInfo)
+ Fn->setMetadata(LLVMContext::MD_preserve_access_index, DbgInfo);
return Fn;
}
diff --git a/llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll b/llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll
index adbcb9f..fe2c196 100644
--- a/llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll
+++ b/llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll
@@ -14,7 +14,7 @@
define dso_local i32 @test(%struct.s* %arg) local_unnamed_addr #0 !dbg !7 {
entry:
call void @llvm.dbg.value(metadata %struct.s* %arg, metadata !17, metadata !DIExpression()), !dbg !18
- %0 = tail call %struct.s* @llvm.preserve.array.access.index.p0s_struct.ss.p0s_struct.ss(%struct.s* %arg, i32 0, i32 2), !dbg !19
+ %0 = tail call %struct.s* @llvm.preserve.array.access.index.p0s_struct.ss.p0s_struct.ss(%struct.s* %arg, i32 0, i32 2), !dbg !19, !llvm.preserve.access.index !11
%1 = tail call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.ss(%struct.s* %0, i32 1, i32 1), !dbg !19, !llvm.preserve.access.index !12
%2 = bitcast i32* %1 to i8*, !dbg !19
%call = tail call i32 @get_value(i8* %2) #4, !dbg !20
--
1.8.3.1

View file

@ -1,28 +0,0 @@
From d15c835028bcc72a8695d047f0acaa530aa54716 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Wed, 31 Jul 2019 20:43:42 -0700
Subject: [PATCH] Filter out cxxflags not supported by clang
---
llvm/tools/llvm-config/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/llvm/tools/llvm-config/CMakeLists.txt b/llvm/tools/llvm-config/CMakeLists.txt
index 8e97a10..9b9b7d1 100644
--- a/llvm/tools/llvm-config/CMakeLists.txt
+++ b/llvm/tools/llvm-config/CMakeLists.txt
@@ -43,7 +43,11 @@ set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR})
set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
set(LLVM_CPPFLAGS "${LLVM_DEFINITIONS}")
set(LLVM_CFLAGS "${LLVM_C_STD_FLAG} ${LLVM_DEFINITIONS}")
+STRING(REGEX REPLACE "-mcet" "" LLVM_CFLAGS ${LLVM_CFLAGS})
+STRING(REGEX REPLACE "-fcf-protection" "" LLVM_CFLAGS ${LLVM_CFLAGS})
set(LLVM_CXXFLAGS "${LLVM_CXX_STD_FLAG} ${LLVM_CXX_STDLIB_FLAG} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
+STRING(REGEX REPLACE "-mcet" "" LLVM_CXXFLAGS ${LLVM_CXXFLAGS})
+STRING(REGEX REPLACE "-fcf-protection" "" LLVM_CXXFLAGS ${LLVM_CXXFLAGS})
set(LLVM_BUILD_SYSTEM cmake)
set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI})
set(LLVM_DYLIB_VERSION "${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}")
--
1.8.3.1

52
hans-gpg-key.asc Normal file
View file

@ -0,0 +1,52 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFS+1SABEACnmkESkY7eZq0GhDjbkWpKmURGk9+ycsfAhA44NqUvf4tk1GPM
5SkJ/fYedYZJaDVhIp98fHgucD0O+vjOzghtgwtITusYjiPHPFBd/MN+MQqSEAP+
LUa/kjHLjgyXxKhFUIDGVaDWL5tKOA7/AQKl1TyJ8lz89NHQoUHFsF/hu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QXQUC
Wl36SwUJDwUmqwAKCRAPwwQuNFrQXT1/D/9YpRDNgaJl3YVDtVZoeQwh7BQ6ULZT
eXFPogYkF2j3VWg8s9UmAs4sg/4a+9KLSantXjX+JFsRv0lQe5Gr/Vl8VQ4LKEXB
fiGmSivjIZ7eopdd3YP2w6G5T3SA4d2CQfsg4rnJPnXIjzKNiSOi368ybnt9fL0Y
2r2aqLTmP6Y7issDUO+J1TW1XHm349JPR0Hl4cTuNnWm4JuX2m2CJEc5XBlDAha9
pUVs+J5C2D0UFFkyeOzeJPwy6x5ApWHm84n8AjhQSpu1qRKxKXdwei6tkQWWMHui
+TgSY/zCkmD9/oY15Ei5avJ4WgIbTLJUoZMi70riPmU8ThjpzA7S+Nk0g7rMPq+X
l1whjKU/u0udlsrIJjzkh6ftqKUmIkbxYTpjhnEujNrEr5m2S6Z6x3y9E5QagBMR
dxRhfk+HbyACcP/p9rXOzl4M291DoKeAAH70GHniGxyNs9rAoMr/hD5XW/Wrz3dc
KMc2s555E6MZILE2ZiolcRn+bYOMPZtWlbx98t8uqMf49gY4FGQBZAwPglMrx7mr
m7HTIiXahThQGOJg6izJDAD5RwSEGlAcL28T8KAuM6CLLkhlBfQwiKsUBNnh9r8w
V3lB+pV0GhL+3i077gTYfZBRwLzjFdhm9xUKEaZ6rN1BX9lzix4eSNK5nln0jUq1
67H2IH//2sf8dw==
=ADVe
-----END PGP PUBLIC KEY BLOCK-----

View file

@ -10,11 +10,12 @@
%global llvm_libdir %{_libdir}/%{name}
%global build_llvm_libdir %{buildroot}%{llvm_libdir}
%global maj_ver 9
%global rc_ver 1
%global baserelease 0.1
%global llvm_srcdir llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src
%global maj_ver 10
%global min_ver 0
%global patch_ver 1
#%%global rc_ver 3
%global baserelease 5
%global patch_ver 0
%if %{with compat_build}
@ -44,23 +45,16 @@ Summary: The Low Level Virtual Machine
License: NCSA
URL: http://llvm.org
Source0: http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz
Source0: http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{llvm_srcdir}.tar.xz
%if %{without compat_build}
Source1: run-lit-tests
Source2: lit.fedora.cfg.py
%endif
Source3: https://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{llvm_srcdir}.tar.xz.sig
Source4: https://prereleases.llvm.org/%{version}/hans-gpg-key.asc
Patch0: 0001-Filter-out-cxxflags-not-supported-by-clang.patch
# TODO: I'm not sure why this is needed. Could be a change in newer version
# of gold.
Patch1: 0001-Pass-target-to-gold-linker-to-avoid-faliures-on-i686.patch
Patch2: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch
Patch3: 0001-CMake-Split-test-binary-exports-into-their-own-expor.patch
Patch4: 0001-AVR-Fix-endianness-handling-in-AVR-MC.patch
# Fix crash in kernel bpf self-tests
Patch5: 0001-BPF-Handling-type-conversions-correctly-for-CO-RE.patch
Patch6: 0001-BPF-annotate-DIType-metadata-for-builtin-preseve_arr.patch
Patch0: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch
Patch1: 0001-CMake-Split-test-binary-exports-into-their-own-expor.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@ -234,6 +228,7 @@ cd _build
-DLLVM_ENABLE_SPHINX:BOOL=ON \
-DLLVM_ENABLE_DOXYGEN:BOOL=OFF \
\
-DLLVM_VERSION_SUFFIX='' \
-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
-DLLVM_DYLIB_EXPORT_ALL:BOOL=ON \
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
@ -485,6 +480,9 @@ fi
%endif
%changelog
* Fri Jan 31 2020 sguelton@redhat.com - 10.0.0-0.1.rc1
- 10.0.0 rc1
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 9.0.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

View file

@ -1 +1 @@
SHA512 (llvm-9.0.1.src.tar.xz) = bfb6960a4dd1e18f4005f324f478a781c69e8ec7c20569d9b243fcb9372dc7733b254f26c683373537990cc9c109c78eaf0f65449629ee17caca1bce9b9ccccd
SHA512 (llvm-10.0.0rc1.src.tar.xz.sig) = 997251b5642002c45f4e0563f2ee2af48b4e4139c7063bf2a1788f0090848f0083f2a30e81449c304c759b7189c06393dc68680c20d708f76bbdd9a126f289cf