From 5df6e6ef1768834b30c289cc3b2fc097b229cb78 Mon Sep 17 00:00:00 2001 From: Ryan Fox Date: Sun, 2 Oct 2022 10:28:18 -0700 Subject: [PATCH] dev-python/llvmlite: new package, add 9999 --- dev-python/llvmlite/Manifest | 3 + .../llvmlite/files/llvmlite-9999-830.patch | 1054 +++++++++++++++++ dev-python/llvmlite/llvmlite-9999.ebuild | 35 + dev-python/llvmlite/metadata.xml | 12 + 4 files changed, 1104 insertions(+) create mode 100644 dev-python/llvmlite/Manifest create mode 100644 dev-python/llvmlite/files/llvmlite-9999-830.patch create mode 100644 dev-python/llvmlite/llvmlite-9999.ebuild create mode 100644 dev-python/llvmlite/metadata.xml diff --git a/dev-python/llvmlite/Manifest b/dev-python/llvmlite/Manifest new file mode 100644 index 0000000..9b32c91 --- /dev/null +++ b/dev-python/llvmlite/Manifest @@ -0,0 +1,3 @@ +AUX llvmlite-9999-830.patch 45913 BLAKE2B 086bd23a287238197906a1c85b63d2eeadcd56cab70e918f32f82f9e47cb710b060317656f39509162919dfa5b1c41e22dd78cdf9403d01361490bfb46a5fb0b SHA512 22d5edc9adb9050fc57d56df6e44f0c02765d11d460cc59ba69fa41d14273ec5e5d476049bb5afcf0ee616ab553dd95977e82cfc1430a85690c908be9d3e97c2 +EBUILD llvmlite-9999.ebuild 840 BLAKE2B 9946594da07688154f02649946979e5256d4dc309bb8707b8258833be464bd6b4a01974325b6699da37c1188756f6d36402e77b809c29e505df73c81a58d629c SHA512 d97f7b95c7cd97072d1154e23a8dfedb063ef4bcad9339c05755a694be37d68d7a989a2826ab6e0cc663bf0fe43463b78c2b14380606093b16573dd30120d468 +MISC metadata.xml 367 BLAKE2B 90089234b5aa1e0ced1e8c5ee6f011209b3e09fb9943bfeffa433fc933398a4f4fe12e0ac74e3f17c1f11331bb39fabc38c9268743e3096cf4cd2b906ba90d42 SHA512 4e4f263e8efc77f803291c78d3dd98c096e584e918c79cba9c8a929bb36939efbe7a0f1fb299806980143c23fb1144b08051dd553a80a889a5c53406d32d72b4 diff --git a/dev-python/llvmlite/files/llvmlite-9999-830.patch b/dev-python/llvmlite/files/llvmlite-9999-830.patch new file mode 100644 index 0000000..22e1a39 --- /dev/null +++ b/dev-python/llvmlite/files/llvmlite-9999-830.patch @@ -0,0 +1,1054 @@ +From cbf829c3d9aafe2f7583b5656a5aee58d7ca1568 Mon Sep 17 00:00:00 2001 +From: Andre Masella +Date: Tue, 5 Apr 2022 15:22:21 -0400 +Subject: [PATCH 1/6] Update to LLVM 12-14 + +Modify llvmlite to support LLVM 11-14 and modify conda recipe to build LLVM14. +Also lift over all patches to LLVM versions as required. +--- + azure-pipelines.yml | 10 - + buildscripts/azure/azure-linux-macos.yml | 6 + + ...-Limit-size-of-non-GlobalValue-name.patch} | 0 + ...tch => llvm11-consecutive_registers.patch} | 0 + ...-entrypoints-in-add-TLI-mappings.ll.patch} | 0 + ...atch => llvm11-intel-D47188-svml-VF.patch} | 0 + ...o-static.patch => llvm11-lto-static.patch} | 0 + ...ing.patch => llvm11-partial-testing.patch} | 0 + ...t-Limit-size-of-non-GlobalValue-name.patch | 49 +++++ + .../llvm12-consecutive_registers.patch | 181 ++++++++++++++++++ + conda-recipes/llvm12-lto-static.patch | 12 ++ + conda-recipes/llvm13-lto-static.patch | 12 ++ + .../llvm14-remove-use-of-clonefile.patch | 55 ++++++ + conda-recipes/llvmdev/bld.bat | 35 +--- + conda-recipes/llvmdev/build.sh | 21 +- + conda-recipes/llvmdev/meta.yaml | 29 +-- + conda-recipes/llvmdev/numba-3016.ll | 80 -------- + ffi/Makefile.freebsd | 2 +- + ffi/Makefile.osx | 4 +- + ffi/build.py | 7 +- + ffi/passmanagers.cpp | 9 +- + ffi/targets.cpp | 8 + + ffi/value.cpp | 13 +- + llvmlite/binding/passmanagers.py | 3 +- + llvmlite/tests/test_binding.py | 2 +- + 25 files changed, 368 insertions(+), 170 deletions(-) + rename conda-recipes/{0001-Revert-Limit-size-of-non-GlobalValue-name.patch => llvm11-0001-Revert-Limit-size-of-non-GlobalValue-name.patch} (100%) + rename conda-recipes/{llvm_11_consecutive_registers.patch => llvm11-consecutive_registers.patch} (100%) + rename conda-recipes/{expect-fastmath-entrypoints-in-add-TLI-mappings.ll.patch => llvm11-expect-fastmath-entrypoints-in-add-TLI-mappings.ll.patch} (100%) + rename conda-recipes/{intel-D47188-svml-VF.patch => llvm11-intel-D47188-svml-VF.patch} (100%) + rename conda-recipes/{llvm-lto-static.patch => llvm11-lto-static.patch} (100%) + rename conda-recipes/{partial-testing.patch => llvm11-partial-testing.patch} (100%) + create mode 100644 conda-recipes/llvm12-0001-Revert-Limit-size-of-non-GlobalValue-name.patch + create mode 100644 conda-recipes/llvm12-consecutive_registers.patch + create mode 100644 conda-recipes/llvm12-lto-static.patch + create mode 100644 conda-recipes/llvm13-lto-static.patch + create mode 100644 conda-recipes/llvm14-remove-use-of-clonefile.patch + delete mode 100644 conda-recipes/llvmdev/numba-3016.ll + +diff --git a/azure-pipelines.yml b/azure-pipelines.yml +index eda3b5797..0b14f975a 100644 +--- a/azure-pipelines.yml ++++ b/azure-pipelines.yml +@@ -69,13 +69,3 @@ jobs: + parameters: + name: Windows + vmImage: windows-2019 +- +-- job: check_formatting +- pool: +- vmImage: 'ubuntu-latest' +- steps: +- - script: | +- set -e +- sudo apt install -y clang-format +- clang-format -n -Werror ffi/*.cpp ffi/*.h +- displayName: Check C++ formatting +diff --git a/buildscripts/azure/azure-linux-macos.yml b/buildscripts/azure/azure-linux-macos.yml +index 48aa9f65d..33a65ab71 100644 +--- a/buildscripts/azure/azure-linux-macos.yml ++++ b/buildscripts/azure/azure-linux-macos.yml +@@ -38,6 +38,12 @@ jobs: + flake8 llvmlite + displayName: 'Flake8' + condition: eq(variables['RUN_FLAKE8'], 'yes') ++ - script: | ++ set -e ++ conda install -y clang-tools ++ clang-format -n -Werror ffi/*.cpp ffi/*.h ++ displayName: Check C++ formatting ++ condition: eq(variables['RUN_CLANG_FORMAT'], 'yes') + + - script: | + set -e +diff --git a/conda-recipes/0001-Revert-Limit-size-of-non-GlobalValue-name.patch b/conda-recipes/llvm11-0001-Revert-Limit-size-of-non-GlobalValue-name.patch +similarity index 100% +rename from conda-recipes/0001-Revert-Limit-size-of-non-GlobalValue-name.patch +rename to conda-recipes/llvm11-0001-Revert-Limit-size-of-non-GlobalValue-name.patch +diff --git a/conda-recipes/llvm_11_consecutive_registers.patch b/conda-recipes/llvm11-consecutive_registers.patch +similarity index 100% +rename from conda-recipes/llvm_11_consecutive_registers.patch +rename to conda-recipes/llvm11-consecutive_registers.patch +diff --git a/conda-recipes/expect-fastmath-entrypoints-in-add-TLI-mappings.ll.patch b/conda-recipes/llvm11-expect-fastmath-entrypoints-in-add-TLI-mappings.ll.patch +similarity index 100% +rename from conda-recipes/expect-fastmath-entrypoints-in-add-TLI-mappings.ll.patch +rename to conda-recipes/llvm11-expect-fastmath-entrypoints-in-add-TLI-mappings.ll.patch +diff --git a/conda-recipes/intel-D47188-svml-VF.patch b/conda-recipes/llvm11-intel-D47188-svml-VF.patch +similarity index 100% +rename from conda-recipes/intel-D47188-svml-VF.patch +rename to conda-recipes/llvm11-intel-D47188-svml-VF.patch +diff --git a/conda-recipes/llvm-lto-static.patch b/conda-recipes/llvm11-lto-static.patch +similarity index 100% +rename from conda-recipes/llvm-lto-static.patch +rename to conda-recipes/llvm11-lto-static.patch +diff --git a/conda-recipes/partial-testing.patch b/conda-recipes/llvm11-partial-testing.patch +similarity index 100% +rename from conda-recipes/partial-testing.patch +rename to conda-recipes/llvm11-partial-testing.patch +diff --git a/conda-recipes/llvm12-0001-Revert-Limit-size-of-non-GlobalValue-name.patch b/conda-recipes/llvm12-0001-Revert-Limit-size-of-non-GlobalValue-name.patch +new file mode 100644 +index 000000000..9b722d36c +--- /dev/null ++++ b/conda-recipes/llvm12-0001-Revert-Limit-size-of-non-GlobalValue-name.patch +@@ -0,0 +1,49 @@ ++diff -ur a/lib/IR/Value.cpp b/lib/IR/Value.cpp ++--- a/lib/IR/Value.cpp 2021-04-06 12:38:18.000000000 -0400 +++++ b/lib/IR/Value.cpp 2022-03-31 15:39:31.000000000 -0400 ++@@ -38,10 +38,6 @@ ++ ++ using namespace llvm; ++ ++-static cl::opt NonGlobalValueMaxNameSize( ++- "non-global-value-max-name-size", cl::Hidden, cl::init(1024), ++- cl::desc("Maximum size for the name of non-global values.")); ++- ++ //===----------------------------------------------------------------------===// ++ // Value Class ++ //===----------------------------------------------------------------------===// ++@@ -319,11 +315,6 @@ ++ if (getName() == NameRef) ++ return; ++ ++- // Cap the size of non-GlobalValue names. ++- if (NameRef.size() > NonGlobalValueMaxNameSize && !isa(this)) ++- NameRef = ++- NameRef.substr(0, std::max(1u, (unsigned)NonGlobalValueMaxNameSize)); ++- ++ assert(!getType()->isVoidTy() && "Cannot assign a name to void values!"); ++ ++ // Get the symbol table to update for this object. ++diff -ur a/test/Bitcode/value-with-long-name.ll b/test/Bitcode/value-with-long-name.ll ++deleted file mode 1000644 ++--- a/test/Bitcode/value-with-long-name.ll +++++ /dev/null ++@@ -1,18 +0,0 @@ ++-; Check the size of generated variable when no option is set ++-; RUN: opt -S %s -O2 -o - | FileCheck -check-prefix=CHECK-LONG %s ++-; CHECK-LONG: %{{[a-z]{4}[a-z]+}} ++- ++-; Then check we correctly cap the size of newly generated non-global values name ++-; Force the size to be small so that the check works on release and debug build ++-; RUN: opt -S %s -O2 -o - -non-global-value-max-name-size=0 | FileCheck -check-prefix=CHECK-SHORT %s ++-; RUN: opt -S %s -O2 -o - -non-global-value-max-name-size=1 | FileCheck -check-prefix=CHECK-SHORT %s ++-; CHECK-SHORT-NOT: %{{[a-z][a-z]+}} ++- ++-define i32 @f(i32 %a, i32 %b) { ++- %c = add i32 %a, %b ++- %d = add i32 %c, %a ++- %e = add i32 %d, %b ++- ret i32 %e ++-} ++- ++- +diff --git a/conda-recipes/llvm12-consecutive_registers.patch b/conda-recipes/llvm12-consecutive_registers.patch +new file mode 100644 +index 000000000..cc60217bd +--- /dev/null ++++ b/conda-recipes/llvm12-consecutive_registers.patch +@@ -0,0 +1,181 @@ ++diff -ur a/include/llvm/CodeGen/TargetLowering.h b/include/llvm/CodeGen/TargetLowering.h ++--- a/include/llvm/CodeGen/TargetLowering.h 2021-04-06 12:38:18.000000000 -0400 +++++ b/include/llvm/CodeGen/TargetLowering.h 2022-03-31 15:52:45.000000000 -0400 ++@@ -3975,7 +3975,8 @@ ++ /// must be passed in a block of consecutive registers. ++ virtual bool ++ functionArgumentNeedsConsecutiveRegisters(Type *Ty, CallingConv::ID CallConv, ++- bool isVarArg) const { +++ bool isVarArg, +++ const DataLayout &DL) const { ++ return false; ++ } ++ ++diff -ur a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp ++--- a/lib/CodeGen/SelectionDAG/FastISel.cpp 2021-04-06 12:38:18.000000000 -0400 +++++ b/lib/CodeGen/SelectionDAG/FastISel.cpp 2022-03-31 15:52:45.000000000 -0400 ++@@ -1087,7 +1087,7 @@ ++ if (Arg.IsByVal) ++ FinalType = cast(Arg.Ty)->getElementType(); ++ bool NeedsRegBlock = TLI.functionArgumentNeedsConsecutiveRegisters( ++- FinalType, CLI.CallConv, CLI.IsVarArg); +++ FinalType, CLI.CallConv, CLI.IsVarArg, DL); ++ ++ ISD::ArgFlagsTy Flags; ++ if (Arg.IsZExt) ++diff -ur a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp ++--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp 2021-04-06 12:38:18.000000000 -0400 +++++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp 2022-03-31 15:52:45.000000000 -0400 ++@@ -1851,7 +1851,7 @@ ++ ++ bool NeedsRegBlock = TLI.functionArgumentNeedsConsecutiveRegisters( ++ I.getOperand(0)->getType(), F->getCallingConv(), ++- /*IsVarArg*/ false); +++ /*IsVarArg*/ false, DL); ++ ++ ISD::NodeType ExtendKind = ISD::ANY_EXTEND; ++ if (F->getAttributes().hasAttribute(AttributeList::ReturnIndex, ++@@ -9229,7 +9229,7 @@ ++ CLI.IsTailCall = false; ++ } else { ++ bool NeedsRegBlock = functionArgumentNeedsConsecutiveRegisters( ++- CLI.RetTy, CLI.CallConv, CLI.IsVarArg); +++ CLI.RetTy, CLI.CallConv, CLI.IsVarArg, DL); ++ for (unsigned I = 0, E = RetTys.size(); I != E; ++I) { ++ ISD::ArgFlagsTy Flags; ++ if (NeedsRegBlock) { ++@@ -9289,7 +9289,7 @@ ++ if (Args[i].IsByVal) ++ FinalType = cast(Args[i].Ty)->getElementType(); ++ bool NeedsRegBlock = functionArgumentNeedsConsecutiveRegisters( ++- FinalType, CLI.CallConv, CLI.IsVarArg); +++ FinalType, CLI.CallConv, CLI.IsVarArg, DL); ++ for (unsigned Value = 0, NumValues = ValueVTs.size(); Value != NumValues; ++ ++Value) { ++ EVT VT = ValueVTs[Value]; ++@@ -9830,7 +9830,7 @@ ++ if (Arg.hasAttribute(Attribute::ByVal)) ++ FinalType = Arg.getParamByValType(); ++ bool NeedsRegBlock = TLI->functionArgumentNeedsConsecutiveRegisters( ++- FinalType, F.getCallingConv(), F.isVarArg()); +++ FinalType, F.getCallingConv(), F.isVarArg(), DL); ++ for (unsigned Value = 0, NumValues = ValueVTs.size(); ++ Value != NumValues; ++Value) { ++ EVT VT = ValueVTs[Value]; ++diff -ur a/lib/Target/AArch64/AArch64ISelLowering.cpp b/lib/Target/AArch64/AArch64ISelLowering.cpp ++--- a/lib/Target/AArch64/AArch64ISelLowering.cpp 2021-04-06 12:38:18.000000000 -0400 +++++ b/lib/Target/AArch64/AArch64ISelLowering.cpp 2022-03-31 15:52:45.000000000 -0400 ++@@ -30,6 +30,7 @@ ++ #include "llvm/ADT/Triple.h" ++ #include "llvm/ADT/Twine.h" ++ #include "llvm/Analysis/VectorUtils.h" +++#include "llvm/CodeGen/Analysis.h" ++ #include "llvm/CodeGen/CallingConvLower.h" ++ #include "llvm/CodeGen/MachineBasicBlock.h" ++ #include "llvm/CodeGen/MachineFrameInfo.h" ++@@ -16455,15 +16456,17 @@ ++ } ++ ++ bool AArch64TargetLowering::functionArgumentNeedsConsecutiveRegisters( ++- Type *Ty, CallingConv::ID CallConv, bool isVarArg) const { ++- if (Ty->isArrayTy()) ++- return true; ++- ++- const TypeSize &TySize = Ty->getPrimitiveSizeInBits(); ++- if (TySize.isScalable() && TySize.getKnownMinSize() > 128) ++- return true; +++ Type *Ty, CallingConv::ID CallConv, bool isVarArg, +++ const DataLayout &DL) const { +++ if (!Ty->isArrayTy()) { +++ const TypeSize &TySize = Ty->getPrimitiveSizeInBits(); +++ return TySize.isScalable() && TySize.getKnownMinSize() > 128; +++ } ++ ++- return false; +++ // All non aggregate members of the type must have the same type +++ SmallVector ValueVTs; +++ ComputeValueVTs(*this, DL, Ty, ValueVTs); +++ return is_splat(ValueVTs); ++ } ++ ++ bool AArch64TargetLowering::shouldNormalizeToSelectSequence(LLVMContext &, ++diff -ur a/lib/Target/AArch64/AArch64ISelLowering.h b/lib/Target/AArch64/AArch64ISelLowering.h ++--- a/lib/Target/AArch64/AArch64ISelLowering.h 2021-04-06 12:38:18.000000000 -0400 +++++ b/lib/Target/AArch64/AArch64ISelLowering.h 2022-03-31 15:52:45.000000000 -0400 ++@@ -770,9 +770,10 @@ ++ MachineMemOperand::Flags getTargetMMOFlags( ++ const Instruction &I) const override; ++ ++- bool functionArgumentNeedsConsecutiveRegisters(Type *Ty, ++- CallingConv::ID CallConv, ++- bool isVarArg) const override; +++ bool functionArgumentNeedsConsecutiveRegisters( +++ Type *Ty, CallingConv::ID CallConv, bool isVarArg, +++ const DataLayout &DL) const override; +++ ++ /// Used for exception handling on Win64. ++ bool needsFixedCatchObjects() const override; ++ ++diff -ur a/lib/Target/AArch64/GISel/AArch64CallLowering.cpp b/lib/Target/AArch64/GISel/AArch64CallLowering.cpp ++--- a/lib/Target/AArch64/GISel/AArch64CallLowering.cpp 2021-04-06 12:38:18.000000000 -0400 +++++ b/lib/Target/AArch64/GISel/AArch64CallLowering.cpp 2022-03-31 15:52:45.000000000 -0400 ++@@ -259,7 +259,7 @@ ++ assert(OrigArg.Regs.size() == SplitVTs.size() && "Regs / types mismatch"); ++ ++ bool NeedsRegBlock = TLI.functionArgumentNeedsConsecutiveRegisters( ++- OrigArg.Ty, CallConv, false); +++ OrigArg.Ty, CallConv, false, DL); ++ for (unsigned i = 0, e = SplitVTs.size(); i < e; ++i) { ++ Type *SplitTy = SplitVTs[i].getTypeForEVT(Ctx); ++ SplitArgs.emplace_back(OrigArg.Regs[i], SplitTy, OrigArg.Flags[0], ++diff -ur a/lib/Target/ARM/ARMCallLowering.cpp b/lib/Target/ARM/ARMCallLowering.cpp ++--- a/lib/Target/ARM/ARMCallLowering.cpp 2021-04-06 12:38:18.000000000 -0400 +++++ b/lib/Target/ARM/ARMCallLowering.cpp 2022-03-31 15:52:45.000000000 -0400 ++@@ -218,7 +218,7 @@ ++ ++ bool NeedsConsecutiveRegisters = ++ TLI.functionArgumentNeedsConsecutiveRegisters( ++- SplitTy, F.getCallingConv(), F.isVarArg()); +++ SplitTy, F.getCallingConv(), F.isVarArg(), DL); ++ if (NeedsConsecutiveRegisters) { ++ Flags.setInConsecutiveRegs(); ++ if (i == e - 1) ++diff -ur a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp ++--- a/lib/Target/ARM/ARMISelLowering.cpp 2021-04-06 12:38:18.000000000 -0400 +++++ b/lib/Target/ARM/ARMISelLowering.cpp 2022-03-31 15:52:45.000000000 -0400 ++@@ -19269,7 +19269,8 @@ ++ /// [N x i32] or [N x i64]. This allows front-ends to skip emitting padding when ++ /// passing according to AAPCS rules. ++ bool ARMTargetLowering::functionArgumentNeedsConsecutiveRegisters( ++- Type *Ty, CallingConv::ID CallConv, bool isVarArg) const { +++ Type *Ty, CallingConv::ID CallConv, bool isVarArg, +++ const DataLayout &DL) const { ++ if (getEffectiveCallingConv(CallConv, isVarArg) != ++ CallingConv::ARM_AAPCS_VFP) ++ return false; ++diff -ur a/lib/Target/ARM/ARMISelLowering.h b/lib/Target/ARM/ARMISelLowering.h ++--- a/lib/Target/ARM/ARMISelLowering.h 2021-04-06 12:38:18.000000000 -0400 +++++ b/lib/Target/ARM/ARMISelLowering.h 2022-03-31 15:52:45.000000000 -0400 ++@@ -578,7 +578,8 @@ ++ /// Returns true if an argument of type Ty needs to be passed in a ++ /// contiguous block of registers in calling convention CallConv. ++ bool functionArgumentNeedsConsecutiveRegisters( ++- Type *Ty, CallingConv::ID CallConv, bool isVarArg) const override; +++ Type *Ty, CallingConv::ID CallConv, bool isVarArg, +++ const DataLayout &DL) const override; ++ ++ /// If a physical register, this returns the register that receives the ++ /// exception address on entry to an EH pad. ++diff -ur a/lib/Target/PowerPC/PPCISelLowering.h b/lib/Target/PowerPC/PPCISelLowering.h ++--- a/lib/Target/PowerPC/PPCISelLowering.h 2021-04-06 12:38:18.000000000 -0400 +++++ b/lib/Target/PowerPC/PPCISelLowering.h 2022-03-31 15:52:45.000000000 -0400 ++@@ -998,7 +998,8 @@ ++ /// Returns true if an argument of type Ty needs to be passed in a ++ /// contiguous block of registers in calling convention CallConv. ++ bool functionArgumentNeedsConsecutiveRegisters( ++- Type *Ty, CallingConv::ID CallConv, bool isVarArg) const override { +++ Type *Ty, CallingConv::ID CallConv, bool isVarArg, +++ const DataLayout &DL) const override { ++ // We support any array type as "consecutive" block in the parameter ++ // save area. The element type defines the alignment requirement and ++ // whether the argument should go in GPRs, FPRs, or VRs if available. +diff --git a/conda-recipes/llvm12-lto-static.patch b/conda-recipes/llvm12-lto-static.patch +new file mode 100644 +index 000000000..76cc55def +--- /dev/null ++++ b/conda-recipes/llvm12-lto-static.patch +@@ -0,0 +1,12 @@ ++diff -ur a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt ++--- llvm-12.0.0.src-orig/tools/lto/CMakeLists.txt 2021-04-06 12:38:18.000000000 -0400 +++++ llvm-12.0.0.src/tools/lto/CMakeLists.txt 2022-03-31 15:46:00.000000000 -0400 ++@@ -21,7 +21,7 @@ ++ ++ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports) ++ ++-add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS +++add_llvm_library(LTO INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS ++ intrinsics_gen) ++ ++ install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h +diff --git a/conda-recipes/llvm13-lto-static.patch b/conda-recipes/llvm13-lto-static.patch +new file mode 100644 +index 000000000..8e63d2b80 +--- /dev/null ++++ b/conda-recipes/llvm13-lto-static.patch +@@ -0,0 +1,12 @@ ++diff -ur llvm-13.0.0.src-orig/llvm/tools/lto/CMakeLists.txt llvm-13.0.0.src/tools/lto/CMakeLists.txt ++--- llvm-13.0.0.src-orig/llvm/tools/lto/CMakeLists.txt 2021-09-24 12:18:10.000000000 -0400 +++++ llvm-13.0.0.src/tools/lto/CMakeLists.txt 2022-03-31 17:07:07.000000000 -0400 ++@@ -25,7 +25,7 @@ ++ set(LTO_LIBRARY_TYPE MODULE) ++ set(LTO_LIBRARY_NAME libLTO) ++ else() ++- set(LTO_LIBRARY_TYPE SHARED) +++ set(LTO_LIBRARY_TYPE STATIC) ++ set(LTO_LIBRARY_NAME LTO) ++ endif() ++ +diff --git a/conda-recipes/llvm14-remove-use-of-clonefile.patch b/conda-recipes/llvm14-remove-use-of-clonefile.patch +new file mode 100644 +index 000000000..f54ceb778 +--- /dev/null ++++ b/conda-recipes/llvm14-remove-use-of-clonefile.patch +@@ -0,0 +1,55 @@ ++diff -ur a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc ++--- a/llvm/lib/Support/Unix/Path.inc 2022-03-14 05:44:55.000000000 -0400 +++++ b/llvm/lib/Support/Unix/Path.inc 2022-09-19 11:30:59.000000000 -0400 ++@@ -1462,6 +1462,7 @@ ++ std::error_code copy_file(const Twine &From, const Twine &To) { ++ std::string FromS = From.str(); ++ std::string ToS = To.str(); +++ /* ++ #if __has_builtin(__builtin_available) ++ if (__builtin_available(macos 10.12, *)) { ++ // Optimistically try to use clonefile() and handle errors, rather than ++@@ -1490,6 +1491,7 @@ ++ // cheaper. ++ } ++ #endif +++ */ ++ if (!copyfile(FromS.c_str(), ToS.c_str(), /*State=*/NULL, COPYFILE_DATA)) ++ return std::error_code(); ++ return std::error_code(errno, std::generic_category()); ++Only in b/llvm/lib/Support/Unix: Path.inc.orig ++diff -ur a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp ++--- a/llvm/unittests/Support/Path.cpp 2022-03-14 05:44:55.000000000 -0400 +++++ b/llvm/unittests/Support/Path.cpp 2022-09-19 11:33:07.000000000 -0400 ++@@ -2267,15 +2267,15 @@ ++ ++ EXPECT_EQ(fs::setPermissions(TempPath, fs::set_uid_on_exe), NoError); ++ EXPECT_TRUE(CheckPermissions(fs::set_uid_on_exe)); ++- +++#if !defined(__APPLE__) ++ EXPECT_EQ(fs::setPermissions(TempPath, fs::set_gid_on_exe), NoError); ++ EXPECT_TRUE(CheckPermissions(fs::set_gid_on_exe)); ++- +++#endif ++ // Modern BSDs require root to set the sticky bit on files. ++ // AIX and Solaris without root will mask off (i.e., lose) the sticky bit ++ // on files. ++ #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && \ ++- !defined(_AIX) && !(defined(__sun__) && defined(__svr4__)) +++ !defined(_AIX) && !(defined(__sun__) && defined(__svr4__)) && !defined(__APPLE__) ++ EXPECT_EQ(fs::setPermissions(TempPath, fs::sticky_bit), NoError); ++ EXPECT_TRUE(CheckPermissions(fs::sticky_bit)); ++ ++@@ -2297,10 +2297,12 @@ ++ EXPECT_TRUE(CheckPermissions(fs::all_perms)); ++ #endif // !FreeBSD && !NetBSD && !OpenBSD && !AIX ++ +++#if !defined(__APPLE__) ++ EXPECT_EQ(fs::setPermissions(TempPath, fs::all_perms & ~fs::sticky_bit), ++ NoError); ++ EXPECT_TRUE(CheckPermissions(fs::all_perms & ~fs::sticky_bit)); ++ #endif +++#endif ++ } ++ ++ #ifdef _WIN32 +diff --git a/conda-recipes/llvmdev/bld.bat b/conda-recipes/llvmdev/bld.bat +index 1ce228c80..8817c156d 100644 +--- a/conda-recipes/llvmdev/bld.bat ++++ b/conda-recipes/llvmdev/bld.bat +@@ -24,31 +24,18 @@ REM the 64bit linker anyway. This must be passed in to certain generators as + REM '-Thost x64'. + set PreferredToolArchitecture=x64 + +-set MAX_INDEX_CMAKE_GENERATOR=2 ++set MAX_INDEX_CMAKE_GENERATOR=0 + +-REM On older generators we can squeete the architecture into the generator +-REM name. In newer generators, we must use the -A flag for cmake to hand in the +-REM correct architecture. Also, using Visual Studio 16 2019 we use toolset +-REM v141, which basically means use a Visual Studio 15 2017 type compiler from +-REM Visual Studio 16 2019. See also: +-REM https://stackoverflow.com/questions/55708600/whats-the-cmake-generator-for-visual-studio-2019 ++set "CMAKE_GENERATOR[0]=Visual Studio 17 2022" + +-set "CMAKE_GENERATOR[0]=Visual Studio 14 2015%ARCH_POSTFIX%" +-set "CMAKE_GENERATOR[1]=Visual Studio 15 2017%ARCH_POSTFIX%" +-set "CMAKE_GENERATOR[2]=Visual Studio 16 2019" ++set "CMAKE_GENERATOR_ARCHITECTURE[0]=%GEN_ARCH%" + +-set "CMAKE_GENERATOR_ARCHITECTURE[0]=" +-set "CMAKE_GENERATOR_ARCHITECTURE[1]=" +-set "CMAKE_GENERATOR_ARCHITECTURE[2]=%GEN_ARCH%" +- +-set "CMAKE_GENERATOR_TOOLSET[0]=host %PreferredToolArchitecture%" +-set "CMAKE_GENERATOR_TOOLSET[1]=host %PreferredToolArchitecture%" +-set "CMAKE_GENERATOR_TOOLSET[2]=v141" ++set "CMAKE_GENERATOR_TOOLSET[0]=" + + REM Reduce build times and package size by removing unused stuff + REM BENCHMARKS (new for llvm8) don't build under Visual Studio 14 2015 + set CMAKE_CUSTOM=-DLLVM_TARGETS_TO_BUILD="%LLVM_TARGETS_TO_BUILD%" ^ +- -DLLVM_INCLUDE_TESTS=OFF ^ ++ -DLLVM_ENABLE_PROJECTS:STRING=lld ^ + -DLLVM_INCLUDE_UTILS=ON ^ + -DLLVM_INCLUDE_DOCS=OFF ^ + -DLLVM_INCLUDE_EXAMPLES=OFF ^ +@@ -67,7 +54,7 @@ for /l %%n in (0,1,%MAX_INDEX_CMAKE_GENERATOR%) do ( + -DCMAKE_BUILD_TYPE="%BUILD_CONFIG%" ^ + -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^ + -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^ +- %CMAKE_CUSTOM% "%SRC_DIR%" ++ %CMAKE_CUSTOM% "%SRC_DIR%\llvm" + if not errorlevel 1 goto configuration_successful + del CMakeCache.txt + ) +@@ -85,13 +72,3 @@ if errorlevel 1 exit 1 + REM === Install step === + cmake --build . --config "%BUILD_CONFIG%" --target install + if errorlevel 1 exit 1 +- +-REM From: https://github.com/conda-forge/llvmdev-feedstock/pull/53 +-"%BUILD_CONFIG%\bin\opt" -S -vector-library=SVML -mcpu=haswell -O3 "%RECIPE_DIR%\numba-3016.ll" | "%BUILD_CONFIG%\bin\FileCheck" "%RECIPE_DIR%\numba-3016.ll" +-if errorlevel 1 exit 1 +- +-REM This is technically how to run the suite, but it will only run in an +-REM enhanced unix-like shell which has functions like `grep` available. +-REM cd ..\test +-REM "%PYTHON%" "..\build\%BUILD_CONFIG%\bin\llvm-lit.py" -vv Transforms ExecutionEngine Analysis CodeGen/X86 +-REM if errorlevel 1 exit 1 +diff --git a/conda-recipes/llvmdev/build.sh b/conda-recipes/llvmdev/build.sh +index fd99eee90..bdaf29769 100644 +--- a/conda-recipes/llvmdev/build.sh ++++ b/conda-recipes/llvmdev/build.sh +@@ -19,6 +19,7 @@ fi + declare -a _cmake_config + _cmake_config+=(-DCMAKE_INSTALL_PREFIX:PATH=${PREFIX}) + _cmake_config+=(-DCMAKE_BUILD_TYPE:STRING=Release) ++_cmake_config+=(-DLLVM_ENABLE_PROJECTS:STRING="lld") + # The bootstrap clang I use was built with a static libLLVMObject.a and I trying to get the same here + # _cmake_config+=(-DBUILD_SHARED_LIBS:BOOL=ON) + _cmake_config+=(-DLLVM_ENABLE_ASSERTIONS:BOOL=ON) +@@ -27,6 +28,7 @@ _cmake_config+=(-DLINK_POLLY_INTO_TOOLS:BOOL=ON) + _cmake_config+=(-DLLVM_ENABLE_LIBXML2:BOOL=OFF) + # Urgh, llvm *really* wants to link to ncurses / terminfo and we *really* do not want it to. + _cmake_config+=(-DHAVE_TERMINFO_CURSES=OFF) ++_cmake_config+=(-DLLVM_ENABLE_TERMINFO=OFF) + # Sometimes these are reported as unused. Whatever. + _cmake_config+=(-DHAVE_TERMINFO_NCURSES=OFF) + _cmake_config+=(-DHAVE_TERMINFO_NCURSESW=OFF) +@@ -39,10 +41,10 @@ _cmake_config+=(-DLLVM_ENABLE_RTTI=OFF) + _cmake_config+=(-DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}) + _cmake_config+=(-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly) + _cmake_config+=(-DLLVM_INCLUDE_UTILS=ON) # for llvm-lit ++_cmake_config+=(-DLLVM_INCLUDE_BENCHMARKS:BOOL=OFF) # doesn't build without the rest of LLVM project + # TODO :: It would be nice if we had a cross-ecosystem 'BUILD_TIME_LIMITED' env var we could use to + # disable these unnecessary but useful things. + if [[ ${CONDA_FORGE} == yes ]]; then +- _cmake_config+=(-DLLVM_INCLUDE_TESTS=OFF) + _cmake_config+=(-DLLVM_INCLUDE_DOCS=OFF) + _cmake_config+=(-DLLVM_INCLUDE_EXAMPLES=OFF) + fi +@@ -76,7 +78,7 @@ cd build + + cmake -G'Unix Makefiles' \ + "${_cmake_config[@]}" \ +- .. ++ ../llvm + + ARCH=`uname -m` + if [ $ARCH == 'armv7l' ]; then # RPi need thread count throttling +@@ -85,18 +87,7 @@ else + make -j${CPU_COUNT} VERBOSE=1 + fi + ++make check-llvm-unit || exit $? ++ + # From: https://github.com/conda-forge/llvmdev-feedstock/pull/53 + make install || exit $? +- +-# SVML tests on x86_64 arch only +-if [[ $ARCH == 'x86_64' ]]; then +- bin/opt -S -vector-library=SVML -mcpu=haswell -O3 $RECIPE_DIR/numba-3016.ll | bin/FileCheck $RECIPE_DIR/numba-3016.ll || exit $? +-fi +- +-# run the tests, skip some on linux-32 +-cd ../test +-if [[ $ARCH == 'i686' ]]; then +- ../build/bin/llvm-lit -vv Transforms Analysis CodeGen/X86 +-else +- ../build/bin/llvm-lit -vv Transforms ExecutionEngine Analysis CodeGen/X86 +-fi +diff --git a/conda-recipes/llvmdev/meta.yaml b/conda-recipes/llvmdev/meta.yaml +index 27b596ffc..3ffb8ac77 100644 +--- a/conda-recipes/llvmdev/meta.yaml ++++ b/conda-recipes/llvmdev/meta.yaml +@@ -1,7 +1,6 @@ +-{% set shortversion = "11.1" %} +-{% set version = "11.1.0" %} +-{% set sha256_llvm = "ce8508e318a01a63d4e8b3090ab2ded3c598a50258cc49e2625b9120d4c03ea5" %} +-{% set sha256_lld = "017a788cbe1ecc4a949abf10755870519086d058a2e99f438829aef24f0c66ce" %} ++{% set shortversion = "14.0" %} ++{% set version = "14.0.1" %} ++{% set sha256_llvm = "1a3c2e57916c5a70153aaf0a0e6f1230d6368b9e0f4d04dcb9e039a31b1cd4e6" %} + {% set build_number = "5" %} + + package: +@@ -9,24 +8,12 @@ package: + version: {{ version }} + + source: +- - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version }}/llvm-{{ version }}.src.tar.xz ++ - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version }}/llvm-project-{{ version }}.src.tar.xz + fn: llvm-{{ version }}.src.tar.xz + sha256: {{ sha256_llvm }} + patches: +- - ../partial-testing.patch +- # Intel SVML optimizations (two patches) +- - ../intel-D47188-svml-VF.patch +- # Second patch from https://github.com/conda-forge/llvmdev-feedstock/blob/c706309/recipe/patches/expect-fastmath-entrypoints-in-add-TLI-mappings.ll.patch +- - ../expect-fastmath-entrypoints-in-add-TLI-mappings.ll.patch +- # Reverts a patch limiting non-GlobalValue name length +- - ../0001-Revert-Limit-size-of-non-GlobalValue-name.patch +- # Fixes for aarch64 on LLVM 11 from https://reviews.llvm.org/D104123 +- - ../llvm_11_consecutive_registers.patch +- +- - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version }}/lld-{{ version }}.src.tar.xz +- fn: lld-{{ version }}.src.tar.xz +- sha256: {{ sha256_lld }} +- folder: tools/lld ++ - ../llvm13-lto-static.patch ++ - ../llvm14-remove-use-of-clonefile.patch + + build: + number: {{ build_number }} +@@ -59,8 +46,6 @@ requirements: + - python # [not (armv6l or armv7l or aarch64 or win)] + + test: +- files: +- - numba-3016.ll + commands: + - $PREFIX/bin/llvm-config --libs # [not win] + - $PREFIX/bin/llc -version # [not win] +@@ -81,5 +66,5 @@ about: + home: http://llvm.org/ + dev_url: https://github.com/llvm-mirror/llvm + license: NCSA +- license_file: LICENSE.TXT ++ license_file: llvm/LICENSE.TXT + summary: Development headers and libraries for LLVM +diff --git a/conda-recipes/llvmdev/numba-3016.ll b/conda-recipes/llvmdev/numba-3016.ll +deleted file mode 100644 +index 1a9b3ecf8..000000000 +--- a/conda-recipes/llvmdev/numba-3016.ll ++++ /dev/null +@@ -1,80 +0,0 @@ +-; Regression test for llvmdev-feedstock#52 and numba#3016 +- +-; Generated from C code: int a[1<<10],b[1<<10]; void foo() { int i=0; for(i=0; i<1<<10; i++) { b[i]=sin(a[i]); }} +-; compiled: -fvectorize -fveclib=SVML -O -S -mavx -mllvm -disable-llvm-optzns -emit-llvm +- +-; RUN: opt -vector-library=SVML -mcpu=haswell -O3 -S < %s | FileCheck %s +-; CHECK: call {{.*}}__svml_sin4_ha( +-; CHECK-NOT: call {{.*}}__svml_sin4( +-; CHECK-NOT: call {{.*}}__svml_sin8 +- +-source_filename = "svml-3016.c" +-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +-target triple = "x86_64-pc-linux-gnu" +- +-@a = common dso_local global [1024 x i32] zeroinitializer, align 16 +-@b = common dso_local global [1024 x i32] zeroinitializer, align 16 +- +-; Function Attrs: nounwind uwtable +-define dso_local void @foo() #0 { +- %1 = alloca i32, align 4 +- %2 = bitcast i32* %1 to i8* +- call void @llvm.lifetime.start.p0i8(i64 4, i8* %2) #3 +- store i32 0, i32* %1, align 4, !tbaa !2 +- store i32 0, i32* %1, align 4, !tbaa !2 +- br label %3 +- +-;