#34 9.0.1 Release
Merged 4 years ago by tstellar. Opened 4 years ago by tstellar.
rpms/ tstellar/llvm f31-9.0.1  into  f31

file modified
+1
@@ -53,3 +53,4 @@ 

  /llvm-9.0.0rc2.src.tar.xz

  /llvm-9.0.0rc3.src.tar.xz

  /llvm-9.0.0.src.tar.xz

+ /llvm-9.0.1.src.tar.xz

@@ -0,0 +1,42 @@ 

+ 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

+ 

@@ -0,0 +1,138 @@ 

+ 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

+ 

file modified
+36 -7
@@ -12,9 +12,9 @@ 

  %global build_llvm_libdir %{buildroot}%{llvm_libdir}

  %global maj_ver 9

  %global min_ver 0

- %global patch_ver 0

+ %global patch_ver 1

  #%%global rc_ver 3

- %global baserelease 1

+ %global baserelease 4

  

  

  %if %{with compat_build}
@@ -56,6 +56,11 @@ 

  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

  

  BuildRequires:	gcc

  BuildRequires:	gcc-c++
@@ -70,7 +75,6 @@ 

  %if %{with gold}

  BuildRequires:	binutils-devel

  %endif

- BuildRequires:	libstdc++-static

  %ifarch %{valgrind_arches}

  # Enable extra functionality when run the LLVM JIT under valgrind.

  BuildRequires:	valgrind-devel
@@ -93,6 +97,7 @@ 

  %package devel

  Summary:	Libraries and header files for LLVM

  Requires:	%{name}%{?_isa} = %{version}-%{release}

+ Requires:	%{name}-libs%{?_isa} = %{version}-%{release}

  # The installed LLVM cmake files will add -ledit to the linker flags for any

  # app that requires the libLLVMLineEditor, so we need to make sure

  # libedit-devel is available.
@@ -132,6 +137,7 @@ 

  %package test

  Summary:	LLVM regression tests

  Requires:	%{name}%{?_isa} = %{version}-%{release}

+ Requires:	%{name}-libs%{?_isa} = %{version}-%{release}

  Requires:	python3-lit

  # The regression tests need gold.

  Requires:	binutils
@@ -165,7 +171,7 @@ 

  mkdir -p _build

  cd _build

  

- %ifarch s390 s390x %{arm} %ix86

+ %ifarch s390 %{arm} %ix86

  # Decrease debuginfo verbosity to reduce memory consumption during final library linking

  %global optflags %(echo %{optflags} | sed 's/-g /-g1 /')

  %endif
@@ -181,7 +187,7 @@ 

  	-DLLVM_PARALLEL_LINK_JOBS=1 \

  	-DCMAKE_BUILD_TYPE=RelWithDebInfo \

  	-DCMAKE_INSTALL_RPATH=";" \

- %ifarch s390 s390x %{arm} %ix86

+ %ifarch s390 %{arm} %ix86

  	-DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \

  	-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \

  %endif
@@ -201,9 +207,7 @@ 

  %if %{with gold}

  	-DLLVM_BINUTILS_INCDIR=%{_includedir} \

  %endif

- %ifnarch s390 s390x

  	-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR \

- %endif

  	\

  	-DLLVM_BUILD_RUNTIME:BOOL=ON \

  	\
@@ -240,6 +244,10 @@ 

  	-DLLVM_INSTALL_SPHINX_HTML_DIR=%{_pkgdocdir}/html \

  	-DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3

  

+ # Build libLLVM.so first.  This ensures that when libLLVM.so is linking, there

+ # are no other compile jobs running.  This will help reduce OOM errors on the

+ # builders without having to artificially limit the number of concurrent jobs.

+ %ninja_build LLVM

  %ninja_build

  

  %install
@@ -477,6 +485,27 @@ 

  %endif

  

  %changelog

+ * Tue Jan 21 2020 Tom Stellard <tstellar@redhat.com> - 9.0.1-4

+ - Rebuild after previous build failed to strip binaries

+ 

+ * Fri Jan 17 2020 Tom Stellard <tstellar@redhat.com> - 9.0.1-3

+ - Add explicit Requires from sub-packages to llvm-libs

+ 

+ * Fri Jan 10 2020 Tom Stellard <tstellar@redhat.com> - 9.0.1-2

+ - Fix crash with kernel bpf self-tests

+ 

+ * Thu Dec 19 2019 tstellar@redhat.com - 9.0.1-1

+ - 9.0.1 Release

+ 

+ * Mon Nov 25 2019 sguelton@redhat.com - 9.0.0-4

+ - Activate AVR on all architectures

+ 

+ * Mon Sep 30 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-3

+ - Build libLLVM.so first to avoid OOM errors

+ 

+ * Fri Sep 27 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-2

+ - Remove unneeded BuildRequires: libstdc++-static

+ 

  * Thu Sep 19 2019 sguelton@redhat.com - 9.0.0-1

  - 9.0.0 Release

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (llvm-9.0.0.src.tar.xz) = 1bb3341e1d231559b948f1505b33c2e2e03989f9b8bbfef0e0cdaff5ac43f85574c9ec5ac53399b914f497d6899425d861411024e8d7e1d1a338c1c6951ac658

+ SHA512 (llvm-9.0.1.src.tar.xz) = bfb6960a4dd1e18f4005f324f478a781c69e8ec7c20569d9b243fcb9372dc7733b254f26c683373537990cc9c109c78eaf0f65449629ee17caca1bce9b9ccccd

@@ -1,3 +0,0 @@ 

- cmake_minimum_required(VERSION 3.4.3)

- 

- find_package(LLVM)

@@ -1,16 +0,0 @@ 

- set -ex

- 

- # This test is meant to ensure that the cmake files in llvm-devel work

- # when only the packages it depends on are installed.

- 

- ARCH=`rpm --eval '%_arch'`

- 

- llvm_devel_num_deps=`dnf repoquery --nvr --requires --resolve llvm-devel.$ARCH | grep '^llvm' | wc -l`

- 

- llvm_num_sub_packages_installed=`dnf list installed | grep  '^llvm' | wc -l`

- 

- # Verify that only llvm-devel dependencies are installed.

- test `expr $llvm_devel_num_deps + 1` -eq $llvm_num_sub_packages_installed

- 

- # Verify that cmake files can me used without errors.

- cmake -G Ninja .

file modified
+9
@@ -14,6 +14,15 @@ 

        - rust-sanity:

            dir: ./

            run: cargo new hello && cd hello && cargo run

+       # There is a bug in the build process when it runs out of disk space

+       # while stripping binaries, which causes the strip to fail, but does

+       # not fail the build.  This results in a libLLVM.so that is over 2GB

+       # which breaks the nightly compose.  So this test checks that libLLVM.so

+       # is less than 100MB to ensure it was successfully stripped.

+       # https://bugzilla.redhat.com/show_bug.cgi?id=1793250

+       - libllvm-size:

+         dir: ./

+         run: test `stat -L -c %s /usr/lib64/libLLVM.so` -lt 100000000

        # This test ensures that the spec file still builds correctly with

        # %global compat_build 1

        # FIXME: This fails, because the CI system has a hard-coded timeout of 4

file modified
+4 -1
@@ -24,5 +24,8 @@ 

        - ninja-build

        - gcc

        - gcc-c++

+     repositories:

+       - repo: "https://src.fedoraproject.org/tests/llvm.git"

+         dest: "llvm"

      tests:

-       - llvm-devel-cmake

+       - llvm/llvm-devel-cmake