1
0
flewkey-overlay/dev-python/llvmlite/files/llvmlite-9999-830.patch

1055 lines
45 KiB
Diff

From cbf829c3d9aafe2f7583b5656a5aee58d7ca1568 Mon Sep 17 00:00:00 2001
From: Andre Masella <andre@masella.name>
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<unsigned> 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<GlobalValue>(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<PointerType>(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<PointerType>(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<EVT, 0> 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
-
-; <label>:3: ; preds = %17, %0
- %4 = load i32, i32* %1, align 4, !tbaa !2
- %5 = icmp slt i32 %4, 1024
- br i1 %5, label %6, label %20
-
-; <label>:6: ; preds = %3
- %7 = load i32, i32* %1, align 4, !tbaa !2
- %8 = sext i32 %7 to i64
- %9 = getelementptr inbounds [1024 x i32], [1024 x i32]* @a, i64 0, i64 %8
- %10 = load i32, i32* %9, align 4, !tbaa !2
- %11 = sitofp i32 %10 to double
- %12 = call double @"llvm.sin.f64"(double %11) #3
- %13 = fptosi double %12 to i32
- %14 = load i32, i32* %1, align 4, !tbaa !2
- %15 = sext i32 %14 to i64
- %16 = getelementptr inbounds [1024 x i32], [1024 x i32]* @b, i64 0, i64 %15
- store i32 %13, i32* %16, align 4, !tbaa !2
- br label %17
-
-; <label>:17: ; preds = %6
- %18 = load i32, i32* %1, align 4, !tbaa !2
- %19 = add nsw i32 %18, 1
- store i32 %19, i32* %1, align 4, !tbaa !2
- br label %3
-
-; <label>:20: ; preds = %3
- %21 = bitcast i32* %1 to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %21) #3
- ret void
-}
-
-; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
-
-; Function Attrs: nounwind
-declare dso_local double @"llvm.sin.f64"(double) #2
-
-; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
-
-attributes #0 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+avx,+fxsr,+mmx,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #1 = { argmemonly nounwind }
-attributes #2 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+avx,+fxsr,+mmx,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave" "unsafe-fp-math"="false" "use-soft-float"="false" }
-attributes #3 = { nounwind }
-
-!llvm.module.flags = !{!0}
-!llvm.ident = !{!1}
-
-!0 = !{i32 1, !"wchar_size", i32 4}
-!1 = !{!"clang version 7.0.0- (trunk)"}
-!2 = !{!3, !3, i64 0}
-!3 = !{!"int", !4, i64 0}
-!4 = !{!"omnipotent char", !5, i64 0}
-!5 = !{!"Simple C/C++ TBAA"}
diff --git a/ffi/Makefile.freebsd b/ffi/Makefile.freebsd
index ba727e331..7b869e876 100644
--- a/ffi/Makefile.freebsd
+++ b/ffi/Makefile.freebsd
@@ -1,5 +1,5 @@
-CXX = clang++ -std=c++11 -stdlib=libc++
+CXX = clang++ -stdlib=libc++
# -flto and --exclude-libs allow us to remove those parts of LLVM we don't use
CXX_FLTO_FLAGS ?= -flto
diff --git a/ffi/Makefile.osx b/ffi/Makefile.osx
index bc192071e..74dccf32c 100644
--- a/ffi/Makefile.osx
+++ b/ffi/Makefile.osx
@@ -1,6 +1,6 @@
-CXX = clang++ -std=c++11 -stdlib=libc++
-CXXFLAGS = $(LLVM_CXXFLAGS)
+CXX = clang++
+CXXFLAGS = $(LLVM_CXXFLAGS) -O3
# Only export the LLVMPY symbols we require and exclude everything else.
EXPORT = "-Wl,-exported_symbol,_LLVMPY_*"
LDFLAGS := $(LDFLAGS) $(EXPORT) $(LLVM_LDFLAGS)
diff --git a/ffi/build.py b/ffi/build.py
index 55343fca5..cb4ac0281 100755
--- a/ffi/build.py
+++ b/ffi/build.py
@@ -163,9 +163,10 @@ def main_posix(kind, library_ext):
print(msg)
print(warning + '\n')
else:
-
- if not out.startswith('11'):
- msg = ("Building llvmlite requires LLVM 11.x.x, got "
+ (version, _) = out.split('.', 1)
+ version = int(version)
+ if version < 11 or version > 14:
+ msg = ("Building llvmlite requires LLVM 11, 12, 13, or 14, got "
"{!r}. Be sure to set LLVM_CONFIG to the right executable "
"path.\nRead the documentation at "
"http://llvmlite.pydata.org/ for more information about "
diff --git a/ffi/passmanagers.cpp b/ffi/passmanagers.cpp
index dd67ca5cc..60064cf10 100644
--- a/ffi/passmanagers.cpp
+++ b/ffi/passmanagers.cpp
@@ -16,11 +16,8 @@
#include "llvm-c/Transforms/IPO.h"
#include "llvm-c/Transforms/Scalar.h"
-#include "llvm/IR/LegacyPassManager.h"
-#if LLVM_VERSION_MAJOR > 11
-#include "llvm/IR/RemarkStreamer.h"
-#endif
#include "llvm/IR/LLVMRemarkStreamer.h"
+#include "llvm/IR/LegacyPassManager.h"
#include "llvm/Remarks/RemarkStreamer.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h"
@@ -220,7 +217,11 @@ LLVMPY_AddLazyValueInfoPass(LLVMPassManagerRef PM) {
}
API_EXPORT(void)
LLVMPY_AddLintPass(LLVMPassManagerRef PM) {
+#if LLVM_VERSION_MAJOR < 12
unwrap(PM)->add(llvm::createLintPass());
+#else
+ unwrap(PM)->add(llvm::createLintLegacyPassPass());
+#endif
}
API_EXPORT(void)
LLVMPY_AddModuleDebugInfoPrinterPass(LLVMPassManagerRef PM) {
diff --git a/ffi/targets.cpp b/ffi/targets.cpp
index 3b5abf510..b96d22c9f 100644
--- a/ffi/targets.cpp
+++ b/ffi/targets.cpp
@@ -6,7 +6,11 @@
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/Host.h"
+#if LLVM_VERSION_MAJOR > 13
+#include "llvm/MC/TargetRegistry.h"
+#else
#include "llvm/Support/TargetRegistry.h"
+#endif
#include "llvm/Target/TargetMachine.h"
#include <cstdio>
@@ -204,7 +208,11 @@ LLVMPY_CreateTargetMachine(LLVMTargetRef T, const char *Triple, const char *CPU,
rm = Reloc::DynamicNoPIC;
TargetOptions opt;
+#if LLVM_VERSION_MAJOR < 12
opt.PrintMachineCode = PrintMC;
+#else
+ opt.MCOptions.ShowMCInst = PrintMC;
+#endif
opt.MCOptions.ABIName = ABIName;
bool jit = JIT;
diff --git a/ffi/value.cpp b/ffi/value.cpp
index 771acd423..01871699d 100644
--- a/ffi/value.cpp
+++ b/ffi/value.cpp
@@ -153,8 +153,13 @@ LLVMPY_ArgumentAttributesIter(LLVMValueRef A) {
using namespace llvm;
Argument *arg = unwrap<Argument>(A);
unsigned argno = arg->getArgNo();
- AttributeSet attrs =
- arg->getParent()->getAttributes().getParamAttributes(argno);
+ const AttributeSet attrs = arg->getParent()->getAttributes().
+#if LLVM_VERSION_MAJOR < 14
+ getParamAttributes(argno)
+#else
+ getParamAttrs(argno)
+#endif
+ ;
return wrap(new AttributeSetIterator(attrs.begin(), attrs.end()));
}
@@ -353,7 +358,11 @@ LLVMPY_GetElementType(LLVMTypeRef type) {
llvm::Type *unwrapped = llvm::unwrap(type);
llvm::PointerType *ty = llvm::dyn_cast<llvm::PointerType>(unwrapped);
if (ty != nullptr) {
+#if LLVM_VERSION_MAJOR < 14
return llvm::wrap(ty->getElementType());
+#else
+ return llvm::wrap(ty->getPointerElementType());
+#endif
}
return nullptr;
}
diff --git a/llvmlite/binding/passmanagers.py b/llvmlite/binding/passmanagers.py
index 26f7bd259..4b9daf468 100644
--- a/llvmlite/binding/passmanagers.py
+++ b/llvmlite/binding/passmanagers.py
@@ -199,7 +199,8 @@ def add_lint_pass(self):
"""
See https://llvm.org/docs/Passes.html#lint-statically-lint-checks-llvm-ir
- LLVM 11+: `llvm::createLintPass`
+ LLVM 11: `llvm::createLintPass`
+ LLVM 12+: `llvm::createLintLegacyPassPass`
""" # noqa E501
ffi.lib.LLVMPY_AddLintPass(self)
diff --git a/llvmlite/tests/test_binding.py b/llvmlite/tests/test_binding.py
index dc4dbc484..70902e04c 100644
--- a/llvmlite/tests/test_binding.py
+++ b/llvmlite/tests/test_binding.py
@@ -640,7 +640,7 @@ def test_set_option(self):
def test_version(self):
major, minor, patch = llvm.llvm_version_info
# one of these can be valid
- valid = [(11,)]
+ valid = [(11,), (12, ), (13, ), (14, )]
self.assertIn((major,), valid)
self.assertIn(patch, range(10))
From 0ac38675a7c3782bdde37f9f4cf47e1568cea621 Mon Sep 17 00:00:00 2001
From: Andre Masella <andre@masella.name>
Date: Tue, 20 Sep 2022 14:02:04 -0400
Subject: [PATCH 2/6] Set versions for creating test packages
DO NOT MERGE
---
conda-recipes/llvmlite/meta.yaml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/conda-recipes/llvmlite/meta.yaml b/conda-recipes/llvmlite/meta.yaml
index 27e09116d..a3d96adf3 100644
--- a/conda-recipes/llvmlite/meta.yaml
+++ b/conda-recipes/llvmlite/meta.yaml
@@ -1,4 +1,4 @@
-{% set VERSION_SUFFIX = "" %} # debug version suffix, appended to the version
+{% set VERSION_SUFFIX = "llvm14" %} # debug version suffix, appended to the version
package:
name: llvmlite
@@ -30,9 +30,9 @@ requirements:
host:
- python
# On channel https://anaconda.org/numba/
- - llvmdev 11.1.0 *5 # [(osx and arm64)]
- - llvmdev 11.1.0 *4 # [not ((osx and arm64) or win)]
- - llvmdev 11.1.0 4 # [win]
+ - llvmdev 14.0.1 *5 # [(osx and arm64)]
+ - llvmdev 14.0.1 *4 # [not ((osx and arm64) or win)]
+ - llvmdev 14.0.1 4 # [win]
- vs2015_runtime # [win]
# llvmdev is built with libz compression support
- zlib # [unix and not (armv6l or armv7l)]
From 39877f9a0988484a82057e16b81ba5343f1fe7dc Mon Sep 17 00:00:00 2001
From: Andre Masella <andre@masella.name>
Date: Tue, 20 Sep 2022 14:19:57 -0400
Subject: [PATCH 3/6] fixup
---
conda-recipes/llvmdev/meta.yaml | 2 +-
conda-recipes/llvmlite/meta.yaml | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/conda-recipes/llvmdev/meta.yaml b/conda-recipes/llvmdev/meta.yaml
index 3ffb8ac77..0b8635b0b 100644
--- a/conda-recipes/llvmdev/meta.yaml
+++ b/conda-recipes/llvmdev/meta.yaml
@@ -1,7 +1,7 @@
{% set shortversion = "14.0" %}
{% set version = "14.0.1" %}
{% set sha256_llvm = "1a3c2e57916c5a70153aaf0a0e6f1230d6368b9e0f4d04dcb9e039a31b1cd4e6" %}
-{% set build_number = "5" %}
+{% set build_number = "0" %}
package:
name: llvmdev
diff --git a/conda-recipes/llvmlite/meta.yaml b/conda-recipes/llvmlite/meta.yaml
index a3d96adf3..9b32443de 100644
--- a/conda-recipes/llvmlite/meta.yaml
+++ b/conda-recipes/llvmlite/meta.yaml
@@ -30,9 +30,7 @@ requirements:
host:
- python
# On channel https://anaconda.org/numba/
- - llvmdev 14.0.1 *5 # [(osx and arm64)]
- - llvmdev 14.0.1 *4 # [not ((osx and arm64) or win)]
- - llvmdev 14.0.1 4 # [win]
+ - llvmdev 14.0.1 0 # [win]
- vs2015_runtime # [win]
# llvmdev is built with libz compression support
- zlib # [unix and not (armv6l or armv7l)]
From a8b783db0e129215f8dea7fa91ac3166e162618d Mon Sep 17 00:00:00 2001
From: Andre Masella <andre@masella.name>
Date: Tue, 20 Sep 2022 14:29:16 -0400
Subject: [PATCH 4/6] fixup
---
conda-recipes/llvmlite/meta.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/conda-recipes/llvmlite/meta.yaml b/conda-recipes/llvmlite/meta.yaml
index 9b32443de..3e0d2b8a9 100644
--- a/conda-recipes/llvmlite/meta.yaml
+++ b/conda-recipes/llvmlite/meta.yaml
@@ -30,7 +30,7 @@ requirements:
host:
- python
# On channel https://anaconda.org/numba/
- - llvmdev 14.0.1 0 # [win]
+ - llvmdev 14.0.1
- vs2015_runtime # [win]
# llvmdev is built with libz compression support
- zlib # [unix and not (armv6l or armv7l)]
From 9dd530b52e1e21d35335bf47c59aee2db33ee02e Mon Sep 17 00:00:00 2001
From: Andre Masella <andre@masella.name>
Date: Thu, 29 Sep 2022 17:07:13 -0400
Subject: [PATCH 5/6] remove-project
---
conda-recipes/llvm13-lto-static.patch | 4 ++--
conda-recipes/llvm14-remove-use-of-clonefile.patch | 10 +++++-----
conda-recipes/llvmdev/meta.yaml | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/conda-recipes/llvm13-lto-static.patch b/conda-recipes/llvm13-lto-static.patch
index 8e63d2b80..b8a624250 100644
--- a/conda-recipes/llvm13-lto-static.patch
+++ b/conda-recipes/llvm13-lto-static.patch
@@ -1,5 +1,5 @@
-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
+diff -ur llvm-13.0.0.src-orig/tools/lto/CMakeLists.txt llvm-13.0.0.src/tools/lto/CMakeLists.txt
+--- llvm-13.0.0.src-orig/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)
diff --git a/conda-recipes/llvm14-remove-use-of-clonefile.patch b/conda-recipes/llvm14-remove-use-of-clonefile.patch
index f54ceb778..d1319742b 100644
--- a/conda-recipes/llvm14-remove-use-of-clonefile.patch
+++ b/conda-recipes/llvm14-remove-use-of-clonefile.patch
@@ -1,6 +1,6 @@
-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
+diff -ur a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc
+--- a/lib/Support/Unix/Path.inc 2022-03-14 05:44:55.000000000 -0400
++++ b/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();
@@ -19,8 +19,8 @@ diff -ur a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
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
+--- a/unittests/Support/Path.cpp 2022-03-14 05:44:55.000000000 -0400
++++ b/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);
diff --git a/conda-recipes/llvmdev/meta.yaml b/conda-recipes/llvmdev/meta.yaml
index 0b8635b0b..5078667e8 100644
--- a/conda-recipes/llvmdev/meta.yaml
+++ b/conda-recipes/llvmdev/meta.yaml
@@ -8,7 +8,7 @@ package:
version: {{ version }}
source:
- - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version }}/llvm-project-{{ version }}.src.tar.xz
+ - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version }}/llvm-{{ version }}.src.tar.xz
fn: llvm-{{ version }}.src.tar.xz
sha256: {{ sha256_llvm }}
patches:
From 45b9f2632970ab4c607b791ecea7d8bf28f6610a Mon Sep 17 00:00:00 2001
From: Andre Masella <andre@masella.name>
Date: Thu, 29 Sep 2022 17:45:04 -0400
Subject: [PATCH 6/6] remove-project
---
conda-recipes/llvmdev/meta.yaml | 1 -
1 file changed, 1 deletion(-)
diff --git a/conda-recipes/llvmdev/meta.yaml b/conda-recipes/llvmdev/meta.yaml
index 5078667e8..eab6561e4 100644
--- a/conda-recipes/llvmdev/meta.yaml
+++ b/conda-recipes/llvmdev/meta.yaml
@@ -12,7 +12,6 @@ source:
fn: llvm-{{ version }}.src.tar.xz
sha256: {{ sha256_llvm }}
patches:
- - ../llvm13-lto-static.patch
- ../llvm14-remove-use-of-clonefile.patch
build: