diff --git a/.gitignore b/.gitignore index 450415d..7fa9892 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/clang-9.0.1.src.tar.xz -SOURCES/llvm-9.0.1.src.tar.xz +SOURCES/clang-10.0.1.src.tar.xz +SOURCES/llvm-10.0.1.src.tar.xz diff --git a/.llvm-compat.metadata b/.llvm-compat.metadata index 2e00f46..27fb020 100644 --- a/.llvm-compat.metadata +++ b/.llvm-compat.metadata @@ -1,2 +1,2 @@ -0d72ce018c85c54fc709c7da71d3dd1463af0bfc SOURCES/clang-9.0.1.src.tar.xz -f7fcf3bd92d130784513c06efe6910f135372ce3 SOURCES/llvm-9.0.1.src.tar.xz +0e61e92b22a620fe7f833fa8b2a56f2db96f7335 SOURCES/clang-10.0.1.src.tar.xz +25d07260f3b7bf4f647e115c4a663fdeda130fbd SOURCES/llvm-10.0.1.src.tar.xz diff --git a/SOURCES/0001-Filter-out-cxxflags-not-supported-by-clang.patch b/SOURCES/0001-Filter-out-cxxflags-not-supported-by-clang.patch deleted file mode 100644 index 1351d2f..0000000 --- a/SOURCES/0001-Filter-out-cxxflags-not-supported-by-clang.patch +++ /dev/null @@ -1,28 +0,0 @@ -From d15c835028bcc72a8695d047f0acaa530aa54716 Mon Sep 17 00:00:00 2001 -From: Tom Stellard -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 - diff --git a/SOURCES/0001-PowerPC-PPCBoolRetToInt-Don-t-translate-Constant-s-o.patch b/SOURCES/0001-PowerPC-PPCBoolRetToInt-Don-t-translate-Constant-s-o.patch new file mode 100644 index 0000000..07b96b8 --- /dev/null +++ b/SOURCES/0001-PowerPC-PPCBoolRetToInt-Don-t-translate-Constant-s-o.patch @@ -0,0 +1,99 @@ +From cbea17568f4301582c1d5d43990f089ca6cff522 Mon Sep 17 00:00:00 2001 +From: Kai Luo +Date: Fri, 28 Aug 2020 01:56:12 +0000 +Subject: [PATCH] [PowerPC] PPCBoolRetToInt: Don't translate Constant's + operands + +When collecting `i1` values via `findAllDefs`, ignore Constant's +operands, since Constant's operands might not be `i1`. + +Fixes https://bugs.llvm.org/show_bug.cgi?id=46923 which causes ICE +``` +llvm-project/llvm/lib/IR/Constants.cpp:1924: static llvm::Constant *llvm::ConstantExpr::getZExt(llvm::Constant *, llvm::Type *, bool): Assertion `C->getType()->getScalarSizeInBits() < Ty->getScalarSizeInBits()&& "SrcTy must be smaller than DestTy for ZExt!"' failed. +``` + +Differential Revision: https://reviews.llvm.org/D85007 +--- + llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp | 15 ++++++----- + llvm/test/CodeGen/PowerPC/pr46923.ll | 29 +++++++++++++++++++++ + 2 files changed, 38 insertions(+), 6 deletions(-) + create mode 100644 llvm/test/CodeGen/PowerPC/pr46923.ll + +diff --git a/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp b/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp +index acc8b317a22..172f1346c50 100644 +--- a/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp ++++ b/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp +@@ -78,9 +78,9 @@ class PPCBoolRetToInt : public FunctionPass { + Value *Curr = WorkList.back(); + WorkList.pop_back(); + auto *CurrUser = dyn_cast(Curr); +- // Operands of CallInst are skipped because they may not be Bool type, +- // and their positions are defined by ABI. +- if (CurrUser && !isa(Curr)) ++ // Operands of CallInst/Constant are skipped because they may not be Bool ++ // type. For CallInst, their positions are defined by ABI. ++ if (CurrUser && !isa(Curr) && !isa(Curr)) + for (auto &Op : CurrUser->operands()) + if (Defs.insert(Op).second) + WorkList.push_back(Op); +@@ -90,6 +90,9 @@ class PPCBoolRetToInt : public FunctionPass { + + // Translate a i1 value to an equivalent i32/i64 value: + Value *translate(Value *V) { ++ assert(V->getType() == Type::getInt1Ty(V->getContext()) && ++ "Expect an i1 value"); ++ + Type *IntTy = ST->isPPC64() ? Type::getInt64Ty(V->getContext()) + : Type::getInt32Ty(V->getContext()); + +@@ -252,9 +255,9 @@ class PPCBoolRetToInt : public FunctionPass { + auto *First = dyn_cast(Pair.first); + auto *Second = dyn_cast(Pair.second); + assert((!First || Second) && "translated from user to non-user!?"); +- // Operands of CallInst are skipped because they may not be Bool type, +- // and their positions are defined by ABI. +- if (First && !isa(First)) ++ // Operands of CallInst/Constant are skipped because they may not be Bool ++ // type. For CallInst, their positions are defined by ABI. ++ if (First && !isa(First) && !isa(First)) + for (unsigned i = 0; i < First->getNumOperands(); ++i) + Second->setOperand(i, BoolToIntMap[First->getOperand(i)]); + } +diff --git a/llvm/test/CodeGen/PowerPC/pr46923.ll b/llvm/test/CodeGen/PowerPC/pr46923.ll +new file mode 100644 +index 00000000000..3e9faa60422 +--- /dev/null ++++ b/llvm/test/CodeGen/PowerPC/pr46923.ll +@@ -0,0 +1,29 @@ ++; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ++; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown \ ++; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s ++ ++@bar = external constant i64, align 8 ++ ++define i1 @foo() { ++; CHECK-LABEL: foo: ++; CHECK: # %bb.0: # %entry ++; CHECK-NEXT: li r3, 0 ++; CHECK-NEXT: isel r3, 0, r3, 4*cr5+lt ++; CHECK-NEXT: blr ++entry: ++ br label %next ++ ++next: ++ br i1 undef, label %true, label %false ++ ++true: ++ br label %end ++ ++false: ++ br label %end ++ ++end: ++ %a = phi i1 [ icmp ugt (i64 0, i64 ptrtoint (i64* @bar to i64)), %true ], ++ [ icmp ugt (i64 0, i64 2), %false ] ++ ret i1 %a ++} +-- +2.25.2 + diff --git a/SOURCES/bab5908df544680ada0a3cf431f55aeccfbdb321.patch b/SOURCES/bab5908df544680ada0a3cf431f55aeccfbdb321.patch new file mode 100644 index 0000000..2a93e6a --- /dev/null +++ b/SOURCES/bab5908df544680ada0a3cf431f55aeccfbdb321.patch @@ -0,0 +1,23 @@ +From bab5908df544680ada0a3cf431f55aeccfbdb321 Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Mon, 13 Apr 2020 13:44:15 +0200 +Subject: [PATCH] Normalize working directory when running llvm-mc in test + +Otherwise, depending on the lit location used to run the test, llvm-mc adds an +include_directories entry in the dwarf output, which breaks tests in some setup. + +Differential Revision: https://reviews.llvm.org/D77876 +--- + llvm/test/MC/MachO/gen-dwarf.s | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/llvm/test/MC/MachO/gen-dwarf.s b/llvm/test/MC/MachO/gen-dwarf.s +index 0813856d625f..6d39d278e818 100644 +--- a/llvm/test/MC/MachO/gen-dwarf.s ++++ b/llvm/test/MC/MachO/gen-dwarf.s +@@ -1,4 +1,4 @@ +-// RUN: llvm-mc -g -triple i386-apple-darwin10 %s -filetype=obj -o %t ++// RUN: mkdir -p %t0 && cd %t0 && llvm-mc -g -triple i386-apple-darwin10 %s -filetype=obj -o %t + // RUN: llvm-dwarfdump -all %t | FileCheck %s + + .globl _bar diff --git a/SPECS/llvm-compat.spec b/SPECS/llvm-compat.spec index cfc7546..3858b6b 100644 --- a/SPECS/llvm-compat.spec +++ b/SPECS/llvm-compat.spec @@ -1,13 +1,10 @@ -%global maj_ver 9 +%global maj_ver 10 %global min_ver 0 %global patch_ver 1 %global baserelease 1 -%ifarch ppc64 ppc64le -%global host_target PowerPC # Limit build jobs on ppc64 systems to avoid running out of memory. %global _smp_mflags -j8 -%endif Name: llvm-compat Version: %{maj_ver}.%{min_ver}.%{patch_ver} @@ -20,12 +17,13 @@ Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{versio Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/clang-%{version}.src.tar.xz # LLVM Patches: -Patch1: 0001-Filter-out-cxxflags-not-supported-by-clang.patch +Patch4: bab5908df544680ada0a3cf431f55aeccfbdb321.patch +Patch5: 0001-PowerPC-PPCBoolRetToInt-Don-t-translate-Constant-s-o.patch # Clang Patches: Patch100: 0002-gtest-reorg.patch Patch102: 0001-ToolChain-Add-lgcc_s-to-the-linker-flags-when-using-.patch -Patch13: 0001-Make-funwind-tables-the-default-for-all-archs.patch +Patch103: 0001-Make-funwind-tables-the-default-for-all-archs.patch BuildRequires: gcc @@ -65,11 +63,12 @@ Shared libraries for the LLVM compiler infrastructure. %patch100 -p1 %patch102 -p1 -%patch13 -p2 +%patch103 -p2 %setup -q -n llvm-%{version}.src -%patch1 -p2 +%patch4 -p2 +%patch5 -p2 %build @@ -160,6 +159,9 @@ install clang-build/%{_lib}/*.so.%{maj_ver} %{buildroot}%{_libdir} %{_libdir}/libclang*.so.%{maj_ver} %changelog +* Fri Sep 25 2020 sguelton@redhat.com - 10.0.1-1 +- 10.0.1 Release + * Tue Apr 7 2020 sguelton@redhat.com - 9.0.0-1 - 9.0.0 Release