Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-llvmlite for openSUSE:Factory 
checked in at 2024-07-08 19:08:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-llvmlite (Old)
 and      /work/SRC/openSUSE:Factory/.python-llvmlite.new.2080 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-llvmlite"

Mon Jul  8 19:08:41 2024 rev:32 rq:1186081 version:0.43.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-llvmlite/python-llvmlite.changes  
2024-04-23 18:56:07.594578247 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-llvmlite.new.2080/python-llvmlite.changes    
    2024-07-08 19:08:59.912360103 +0200
@@ -1,0 +2,7 @@
+Mon Jul  1 05:09:25 UTC 2024 - Steve Kowalik <steven.kowa...@suse.com>
+
+- Update to 0.43.0:
+  * Support for building against LLVM 15.
+  * A fix for `refpruning` algorithm in specific `fanout_raise` cases.
+
+-------------------------------------------------------------------

Old:
----
  llvmlite-0.42.0.tar.gz

New:
----
  llvmlite-0.43.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-llvmlite.spec ++++++
--- /var/tmp/diff_new_pack.rF75n6/_old  2024-07-08 19:09:00.608385558 +0200
+++ /var/tmp/diff_new_pack.rF75n6/_new  2024-07-08 19:09:00.612385705 +0200
@@ -21,13 +21,13 @@
 %{?sle15_python_module_pythons}
 Name:           python-llvmlite
 # Note: this has to be in sync with Numba releases
-Version:        0.42.0
+Version:        0.43.0
 Release:        0
 Summary:        Lightweight wrapper around basic LLVM functionality
 License:        BSD-2-Clause
 URL:            https://llvmlite.pydata.org
 Source:         
https://github.com/numba/llvmlite/archive/v%{version}.tar.gz#/llvmlite-%{version}.tar.gz
-BuildRequires:  %{python_module devel >= 3.8}
+BuildRequires:  %{python_module devel >= 3.9}
 BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module wheel}
@@ -83,5 +83,5 @@
 %doc README.rst
 %doc examples/
 %{python_sitearch}/llvmlite/
-%{python_sitearch}/llvmlite-%{version}*-info
+%{python_sitearch}/llvmlite-%{version}.dist-info
 

++++++ llvmlite-0.42.0.tar.gz -> llvmlite-0.43.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/CHANGE_LOG 
new/llvmlite-0.43.0/CHANGE_LOG
--- old/llvmlite-0.42.0/CHANGE_LOG      2024-01-31 16:18:23.000000000 +0100
+++ new/llvmlite-0.43.0/CHANGE_LOG      2024-06-11 17:24:27.000000000 +0200
@@ -1,3 +1,28 @@
+v0.43.0 (June 13, 2024)
+-----------------------
+
+Highlights of this release are:
+
+- Support for building against LLVM 15.
+- A fix for `refpruning` algorithm in specific `fanout_raise` cases.
+
+Pull-Requests:
+
+* PR `#1025 <https://github.com/numba/llvmlite/pull/1025>`_: skip `raise` 
basic blocks in `verifyFanoutBackward` (`dlee992 <https://github.com/dlee992>`_)
+* PR `#1029 <https://github.com/numba/llvmlite/pull/1029>`_: Update CHANGE_LOG 
for 0.42.0 final. (`stuartarchibald <https://github.com/stuartarchibald>`_)
+* PR `#1032 <https://github.com/numba/llvmlite/pull/1032>`_: v0.42 Post 
release  (`sklam <https://github.com/sklam>`_)
+* PR `#1035 <https://github.com/numba/llvmlite/pull/1035>`_:  Support building 
against llvm15 (`gmarkall <https://github.com/gmarkall>`_ `yashssh 
<https://github.com/yashssh>`_)
+* PR `#1059 <https://github.com/numba/llvmlite/pull/1059>`_: update CHANGE_LOG 
and release date for 0.43.0 final (`esc <https://github.com/esc>`_)
+
+Authors:
+
+* `dlee992 <https://github.com/dlee992>`_
+* `esc <https://github.com/esc>`_
+* `gmarkall <https://github.com/gmarkall>`_
+* `sklam <https://github.com/sklam>`_
+* `stuartarchibald <https://github.com/stuartarchibald>`_
+* `yashssh <https://github.com/yashssh>`_
+
 v0.42.0 (January 31, 2024)
 --------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/azure-pipelines.yml 
new/llvmlite-0.43.0/azure-pipelines.yml
--- old/llvmlite-0.42.0/azure-pipelines.yml     2024-01-31 16:18:23.000000000 
+0100
+++ new/llvmlite-0.43.0/azure-pipelines.yml     2024-06-11 17:24:27.000000000 
+0200
@@ -18,6 +18,11 @@
         PYTHON: '3.12'
         CONDA_ENV: cienv
 
+      llvm15:
+        PYTHON: '3.12'
+        CONDA_ENV: cienv
+        LLVM: '15'
+
 - template: buildscripts/azure/azure-linux-macos.yml
   parameters:
     name: Linux
@@ -67,6 +72,11 @@
         CONDA_ENV: cienv
         BUILD_DOCS: 'yes'
 
+      llvm15:
+        PYTHON: '3.12'
+        CONDA_ENV: cienv
+        LLVM: '15'
+
 - template: buildscripts/azure/azure-windows.yml
   parameters:
     name: Windows
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/buildscripts/azure/azure-windows.yml 
new/llvmlite-0.43.0/buildscripts/azure/azure-windows.yml
--- old/llvmlite-0.42.0/buildscripts/azure/azure-windows.yml    2024-01-31 
16:18:23.000000000 +0100
+++ new/llvmlite-0.43.0/buildscripts/azure/azure-windows.yml    2024-06-11 
17:24:27.000000000 +0200
@@ -22,6 +22,10 @@
         PYTHON: '3.12'
         CONDA_ENV: cienv
 
+      llvm15:
+        PYTHON: '3.12'
+        CONDA_ENV: cienv
+        LLVM: '15'
 
   steps:
 
@@ -33,11 +37,7 @@
 
     - script: |
         call C:\Miniconda3\Scripts\activate.bat
-        call conda list
-        call conda remove --all -q -y -n %CONDA_ENV%
-        call conda create -n %CONDA_ENV% -q -y python=%PYTHON% cmake
-        call activate %CONDA_ENV%
-        call conda install -y -q -c numba/label/dev llvmdev="14.*" libxml2
+        call buildscripts\\incremental\\setup_conda_environment.cmd
       displayName: 'Before Install'
 
     - script: |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/buildscripts/incremental/build.cmd 
new/llvmlite-0.43.0/buildscripts/incremental/build.cmd
--- old/llvmlite-0.42.0/buildscripts/incremental/build.cmd      2024-01-31 
16:18:23.000000000 +0100
+++ new/llvmlite-0.43.0/buildscripts/incremental/build.cmd      2024-06-11 
17:24:27.000000000 +0200
@@ -1,4 +1,23 @@
 
 call activate %CONDA_ENV%
 
+@rem LLVM derives the location of diaguids.lib from the build-time environment.
+@rem Conda-forge packaging works around this by substituting the build-time
+@rem location of Visual Studio with $ENV{VSINSTALLDIR}. In order to ensure that
+@rem this environment variable is set appropriately, we activate the Visual
+@rem Studio Developer Command Prompt prior to running setup.py
+@rem
+@rem This workaround is required whilst using LLVM from conda-forge; it may 
also
+@rem be necessary to consider a workaround for our own llvmdev packages.
+@rem
+@rem For more info, see:
+@rem
+@rem - https://github.com/conda-forge/llvmdev-feedstock/issues/175
+@rem - https://github.com/conda-forge/llvmdev-feedstock/pull/223
+@rem - https://github.com/MicrosoftDocs/visualstudio-docs/issues/7774
+if "%LLVM%"=="15" (
+  call "C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat"
+  if %errorlevel% neq 0 exit /b %errorlevel%
+)
+
 python setup.py build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/llvmlite-0.42.0/buildscripts/incremental/setup_conda_environment.cmd 
new/llvmlite-0.43.0/buildscripts/incremental/setup_conda_environment.cmd
--- old/llvmlite-0.42.0/buildscripts/incremental/setup_conda_environment.cmd    
2024-01-31 16:18:23.000000000 +0100
+++ new/llvmlite-0.43.0/buildscripts/incremental/setup_conda_environment.cmd    
2024-06-11 17:24:27.000000000 +0200
@@ -1,24 +1,24 @@
-@rem The cmd /C hack circumvents a regression where conda installs a conda.bat
-@rem script in non-root environments.
-set CONDA_INSTALL=cmd /C conda install -q -y
-set PIP_INSTALL=pip install -q
-
 @echo on
 
-@rem Deactivate any environment
-call deactivate
 @rem Display root environment (for debugging)
-conda list
+call conda list
+
 @rem Clean up any left-over from a previous build
-conda remove --all -q -y -n %CONDA_ENV%
+call conda remove --all -q -y -n %CONDA_ENV%
 
 @rem Create and populate environment
-conda create -n %CONDA_ENV% -q -y python=%PYTHON% cmake
+call conda create -n %CONDA_ENV% -q -y python=%PYTHON% cmake
 if %errorlevel% neq 0 exit /b %errorlevel%
 
 call activate %CONDA_ENV%
 if %errorlevel% neq 0 exit /b %errorlevel%
 
 @rem Install llvmdev
-%CONDA_INSTALL% -c numba/label/dev llvmdev="14.*"
+if "%LLVM%"=="15" (
+  set LLVMDEV_CHANNEL="conda-forge"
+) else (
+  set LLVMDEV_CHANNEL="numba/label/dev"
+)
+
+call conda install -y -q -c %LLVMDEV_CHANNEL% llvmdev="%LLVM%" libxml2
 if %errorlevel% neq 0 exit /b %errorlevel%
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/llvmlite-0.42.0/buildscripts/incremental/setup_conda_environment.sh 
new/llvmlite-0.43.0/buildscripts/incremental/setup_conda_environment.sh
--- old/llvmlite-0.42.0/buildscripts/incremental/setup_conda_environment.sh     
2024-01-31 16:18:23.000000000 +0100
+++ new/llvmlite-0.43.0/buildscripts/incremental/setup_conda_environment.sh     
2024-06-11 17:24:27.000000000 +0200
@@ -27,7 +27,11 @@
 set -v
 
 # Install llvmdev (separate channel, for now)
-$CONDA_INSTALL -c numba/label/dev llvmdev="14.*"
+if [ "$LLVM" == "15" ]; then
+    $CONDA_INSTALL -c conda-forge llvmdev="15"
+else
+    $CONDA_INSTALL -c numba/label/dev llvmdev="14.*"
+fi
 
 # Install the compiler toolchain, for osx, bootstrapping needed
 # which happens in build.sh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/ffi/CMakeLists.txt 
new/llvmlite-0.43.0/ffi/CMakeLists.txt
--- old/llvmlite-0.42.0/ffi/CMakeLists.txt      2024-01-31 16:18:23.000000000 
+0100
+++ new/llvmlite-0.43.0/ffi/CMakeLists.txt      2024-06-11 17:24:27.000000000 
+0200
@@ -11,6 +11,10 @@
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -g")
 endif()
 
+# Work around llvm/llvm-project#83802 - LLVM's Findzstd.cmake uses variables
+# that require including `GNUInstallDirs`, but it does not include it itself.
+include(GNUInstallDirs)
+
 find_package(LLVM REQUIRED CONFIG)
 
 message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/ffi/build.py 
new/llvmlite-0.43.0/ffi/build.py
--- old/llvmlite-0.42.0/ffi/build.py    2024-01-31 16:18:23.000000000 +0100
+++ new/llvmlite-0.43.0/ffi/build.py    2024-06-11 17:24:27.000000000 +0200
@@ -53,6 +53,13 @@
     return out
 
 
+def show_warning(message):
+    header = ' * '.join(("WARNING",) * 8)
+    blk = '=' * 80
+    warning = f'{blk}\n{header}\n{blk}'
+    print(f"{warning}\n{message}\n{warning}")
+
+
 def find_windows_generator():
     """
     Find a suitable cmake "generator" under Windows.
@@ -156,16 +163,16 @@
                "overridden.\nThis is unsupported behaviour, llvmlite may not "
                "work as intended.\nRequested LLVM version: {}".format(
                    out.strip()))
-        warn = ' * '.join(("WARNING",) * 8)
-        blk = '=' * 80
-        warning = '{}\n{}\n{}'.format(blk, warn, blk)
-        print(warning)
-        print(msg)
-        print(warning + '\n')
+        show_warning(msg)
     else:
         (version, _) = out.split('.', 1)
         version = int(version)
-        if version != 14:
+        if version == 15:
+            msg = ("Building with LLVM 15; note that LLVM 15 support is "
+                   "presently experimental")
+            show_warning(msg)
+        elif version != 14:
+
             msg = ("Building llvmlite requires LLVM 14, got "
                    "{!r}. Be sure to set LLVM_CONFIG to the right executable "
                    "path.\nRead the documentation at "
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/ffi/core.cpp 
new/llvmlite-0.43.0/ffi/core.cpp
--- old/llvmlite-0.42.0/ffi/core.cpp    2024-01-31 16:18:23.000000000 +0100
+++ new/llvmlite-0.43.0/ffi/core.cpp    2024-06-11 17:24:27.000000000 +0200
@@ -21,10 +21,22 @@
 LLVMPY_DisposeString(const char *msg) { free(const_cast<char *>(msg)); }
 
 API_EXPORT(LLVMContextRef)
-LLVMPY_GetGlobalContext() { return LLVMGetGlobalContext(); }
+LLVMPY_GetGlobalContext() {
+    auto context = LLVMGetGlobalContext();
+#if LLVM_VERSION_MAJOR > 14
+    LLVMContextSetOpaquePointers(context, false);
+#endif
+    return context;
+}
 
 API_EXPORT(LLVMContextRef)
-LLVMPY_ContextCreate() { return LLVMContextCreate(); }
+LLVMPY_ContextCreate() {
+    LLVMContextRef context = LLVMContextCreate();
+#if LLVM_VERSION_MAJOR > 14
+    LLVMContextSetOpaquePointers(context, false);
+#endif
+    return context;
+}
 
 API_EXPORT(void)
 LLVMPY_ContextDispose(LLVMContextRef context) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/ffi/core.h 
new/llvmlite-0.43.0/ffi/core.h
--- old/llvmlite-0.42.0/ffi/core.h      2024-01-31 16:18:23.000000000 +0100
+++ new/llvmlite-0.43.0/ffi/core.h      2024-06-11 17:24:27.000000000 +0200
@@ -2,6 +2,11 @@
 #define LLVMPY_CORE_H_
 
 #include "llvm-c/Core.h"
+
+// Needed for macros that control version-specific behaviour - included here so
+// that they are available in all ffi translation units
+#include "llvm/Config/llvm-config.h"
+
 #include <cstdlib>
 #include <cstring>
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/ffi/custom_passes.cpp 
new/llvmlite-0.43.0/ffi/custom_passes.cpp
--- old/llvmlite-0.42.0/ffi/custom_passes.cpp   2024-01-31 16:18:23.000000000 
+0100
+++ new/llvmlite-0.43.0/ffi/custom_passes.cpp   2024-06-11 17:24:27.000000000 
+0200
@@ -400,7 +400,8 @@
                     SmallBBSet tail_nodes;
                     tail_nodes.insert(decref->getParent());
                     if (!verifyFanoutBackward(incref, incref->getParent(),
-                                              &tail_nodes))
+                                              &tail_nodes, false))
+
                         continue;
 
                     // scan the CFG between the incref and decref BBs, if
@@ -495,6 +496,29 @@
      *   │ MORE CFG   │
      *   └────────────┘
      *
+     * a complex pattern about fanout-raise
+     * https://github.com/numba/llvmlite/issues/1023
+     *           ┌────────────┐
+     *           │   incref   │
+     *           │   incref   │
+     *           └────────────┘
+     *             /           \
+     *            /             \
+     *     ┌────────────┐        \
+     *     │   decref   |         \
+     *     └────────────┘          \
+     *      /          \            \
+     *     /            \            \
+     * ┌────────────┐ 
┌────────────┐  \
+     * │   decref   | │   incref   |   \
+     * └────────────┘ 
└────────────┘    \
+     *                 /            \    \
+     *                /              \    \
+     *           ┌────────────┐      
┌────────────┐
+     *           │   decref   |      │   raise    |
+     *           │   decref   |      
└────────────┘
+     *           └────────────┘
+     *
      * Parameters:
      *  - F a Function
      *  - prune_raise_exit, if false case 1 is considered, if true case 2 is
@@ -648,10 +672,12 @@
                 for (BasicBlock *bb : *decref_blocks) {
                     raising_blocks.insert(bb);
                 }
-                if (verifyFanoutBackward(incref, head_node, p_raising_blocks))
+                if (verifyFanoutBackward(incref, head_node, p_raising_blocks,
+                                         prune_raise_exit))
                     return true;
 
-            } else if (verifyFanoutBackward(incref, head_node, decref_blocks)) 
{
+            } else if (verifyFanoutBackward(incref, head_node, decref_blocks,
+                                            prune_raise_exit)) {
                 return true;
             }
         }
@@ -844,7 +870,8 @@
      *
      */
     bool verifyFanoutBackward(CallInst *incref, BasicBlock *head_node,
-                              const SmallBBSet *tail_nodes) {
+                              const SmallBBSet *tail_nodes,
+                              bool prune_raise_exit) {
         // push the tail nodes into a work list
         SmallVector<BasicBlock *, 10> todo;
         for (BasicBlock *bb : *tail_nodes) {
@@ -864,6 +891,10 @@
             while (workstack.size() > 0) {
                 // Get a basic block
                 BasicBlock *cur_node = workstack.pop_back_val();
+                // If cur_node is a raising block, then skip it
+                if (prune_raise_exit && isRaising(cur_node)) {
+                    continue;
+                }
                 // if the block has been seen before then skip
                 if (visited.count(cur_node)) {
                     // Already visited
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/ffi/orcjit.cpp 
new/llvmlite-0.43.0/ffi/orcjit.cpp
--- old/llvmlite-0.42.0/ffi/orcjit.cpp  2024-01-31 16:18:23.000000000 +0100
+++ new/llvmlite-0.43.0/ffi/orcjit.cpp  2024-06-11 17:24:27.000000000 +0200
@@ -158,7 +158,12 @@
         return nullptr;
     }
 
+#if LLVM_VERSION_MAJOR > 14
+    *addr = sym->getValue();
+#else
     *addr = sym->getAddress();
+#endif
+
     return new JITDylibTracker(*lljit, *dylib,
                                std::move(dylib->createResourceTracker()));
 }
@@ -334,7 +339,11 @@
             LLVMDisposeErrorMessage(message);
             return nullptr;
         }
+#if LLVM_VERSION_MAJOR > 14
+        exports[export_idx].address = lookup->getValue();
+#else
         exports[export_idx].address = lookup->getAddress();
+#endif
     }
     return new JITDylibTracker(*lljit, *dylib,
                                std::move(dylib->getDefaultResourceTracker()));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/ffi/passmanagers.cpp 
new/llvmlite-0.43.0/ffi/passmanagers.cpp
--- old/llvmlite-0.42.0/ffi/passmanagers.cpp    2024-01-31 16:18:23.000000000 
+0100
+++ new/llvmlite-0.43.0/ffi/passmanagers.cpp    2024-06-11 17:24:27.000000000 
+0200
@@ -39,6 +39,7 @@
 #include <llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h>
 #include <llvm/Transforms/IPO.h>
 #include <llvm/Transforms/IPO/AlwaysInliner.h>
+#include <llvm/Transforms/Scalar/SimpleLoopUnswitch.h>
 #include <llvm/Transforms/Utils.h>
 #include <llvm/Transforms/Utils/UnifyFunctionExitNodes.h>
 using namespace llvm;
@@ -161,8 +162,13 @@
 
 API_EXPORT(void)
 LLVMPY_AddDotDomPrinterPass(LLVMPassManagerRef PM, bool showBody) {
+#if LLVM_VERSION_MAJOR > 14
+    unwrap(PM)->add(showBody ? llvm::createDomPrinterWrapperPassPass()
+                             : llvm::createDomOnlyPrinterWrapperPassPass());
+#else
     unwrap(PM)->add(showBody ? llvm::createDomPrinterPass()
                              : llvm::createDomOnlyPrinterPass());
+#endif
 }
 
 API_EXPORT(void)
@@ -172,8 +178,13 @@
 
 API_EXPORT(void)
 LLVMPY_AddDotPostDomPrinterPass(LLVMPassManagerRef PM, bool showBody) {
+#if LLVM_VERSION_MAJOR > 14
+    unwrap(PM)->add(showBody ? llvm::createPostDomPrinterWrapperPassPass()
+                             : 
llvm::createPostDomOnlyPrinterWrapperPassPass());
+#else
     unwrap(PM)->add(showBody ? llvm::createPostDomPrinterPass()
                              : llvm::createPostDomOnlyPrinterPass());
+#endif
 }
 
 API_EXPORT(void)
@@ -244,10 +255,12 @@
     unwrap(PM)->add(llvm::createAlwaysInlinerLegacyPass(insertLifetime));
 }
 
+#if LLVM_VERSION_MAJOR < 15
 API_EXPORT(void)
 LLVMPY_AddArgPromotionPass(LLVMPassManagerRef PM, unsigned int maxElements) {
     unwrap(PM)->add(llvm::createArgumentPromotionPass(maxElements));
 }
+#endif
 
 API_EXPORT(void)
 LLVMPY_AddBreakCriticalEdgesPass(LLVMPassManagerRef PM) {
@@ -336,8 +349,12 @@
 API_EXPORT(void)
 LLVMPY_AddLoopUnswitchPass(LLVMPassManagerRef PM, bool optimizeForSize,
                            bool hasBranchDivergence) {
+#if LLVM_VERSION_MAJOR > 14
+    unwrap(PM)->add(createSimpleLoopUnswitchLegacyPass(optimizeForSize));
+#else
     unwrap(PM)->add(
         createLoopUnswitchPass(optimizeForSize, hasBranchDivergence));
+#endif
 }
 
 API_EXPORT(void)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/ffi/value.cpp 
new/llvmlite-0.43.0/ffi/value.cpp
--- old/llvmlite-0.42.0/ffi/value.cpp   2024-01-31 16:18:23.000000000 +0100
+++ new/llvmlite-0.43.0/ffi/value.cpp   2024-06-11 17:24:27.000000000 +0200
@@ -6,6 +6,9 @@
 
 // the following is needed for WriteGraph()
 #include "llvm/Analysis/CFGPrinter.h"
+#if LLVM_VERSION_MAJOR > 14
+#include "llvm/Support/GraphWriter.h"
+#endif
 
 /* An iterator around a attribute list, including the stop condition */
 struct AttributeListIterator {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/llvmlite/_version.py 
new/llvmlite-0.43.0/llvmlite/_version.py
--- old/llvmlite-0.42.0/llvmlite/_version.py    2024-01-31 16:18:23.000000000 
+0100
+++ new/llvmlite-0.43.0/llvmlite/_version.py    2024-06-11 17:24:27.000000000 
+0200
@@ -9,8 +9,8 @@
 # versioneer-0.12 (https://github.com/warner/python-versioneer)
 
 # these strings will be replaced by git during git-archive
-git_refnames = " (tag: v0.42.0, release0.42)"
-git_full = "b2a26aafd266b8972ad26dfa98dc41642f84913e"
+git_refnames = " (tag: v0.43.0, release0.43)"
+git_full = "6c786059354260a0ae93f9d0144d4016ab3d63b4"
 
 # these strings are filled in when 'setup.py versioneer' creates _version.py
 tag_prefix = "v"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/llvmlite/binding/passmanagers.py 
new/llvmlite-0.43.0/llvmlite/binding/passmanagers.py
--- old/llvmlite-0.42.0/llvmlite/binding/passmanagers.py        2024-01-31 
16:18:23.000000000 +0100
+++ new/llvmlite-0.43.0/llvmlite/binding/passmanagers.py        2024-06-11 
17:24:27.000000000 +0200
@@ -3,6 +3,7 @@
 from collections import namedtuple
 from enum import IntFlag
 from llvmlite.binding import ffi
+from llvmlite.binding.initfini import llvm_version_info
 import os
 from tempfile import mkstemp
 from llvmlite.binding.common import _encode_string
@@ -10,6 +11,8 @@
 _prunestats = namedtuple('PruneStats',
                          ('basicblock diamond fanout fanout_raise'))
 
+llvm_version_major = llvm_version_info[0]
+
 
 class PruneStats(_prunestats):
     """ Holds statistics from reference count pruning.
@@ -258,6 +261,8 @@
 
         LLVM 14: `llvm::createArgumentPromotionPass`
         """  # noqa E501
+        if llvm_version_major > 14:
+            raise RuntimeError('ArgumentPromotionPass unavailable in LLVM > 
14')
         ffi.lib.LLVMPY_AddArgPromotionPass(self, max_elements)
 
     def add_break_critical_edges_pass(self):
@@ -466,9 +471,9 @@
         See https://llvm.org/docs/Passes.html#loop-unswitch-unswitch-loops
 
         LLVM 14: `llvm::createLoopUnswitchPass`
+        LLVM 15: `llvm::createSimpleLoopUnswitchLegacyPass`
         """  # noqa E501
-        ffi.lib.LLVMPY_AddLoopUnswitchPass(self,
-                                           optimize_for_size,
+        ffi.lib.LLVMPY_AddLoopUnswitchPass(self, optimize_for_size,
                                            has_branch_divergence)
 
     def add_lower_atomic_pass(self):
@@ -866,7 +871,11 @@
 ffi.lib.LLVMPY_AddScalarEvolutionAAPass.argtypes = [ffi.LLVMPassManagerRef]
 ffi.lib.LLVMPY_AddAggressiveDCEPass.argtypes = [ffi.LLVMPassManagerRef]
 ffi.lib.LLVMPY_AddAlwaysInlinerPass.argtypes = [ffi.LLVMPassManagerRef, c_bool]
-ffi.lib.LLVMPY_AddArgPromotionPass.argtypes = [ffi.LLVMPassManagerRef, c_uint]
+
+if llvm_version_major < 15:
+    ffi.lib.LLVMPY_AddArgPromotionPass.argtypes = [
+        ffi.LLVMPassManagerRef, c_uint]
+
 ffi.lib.LLVMPY_AddBreakCriticalEdgesPass.argtypes = [ffi.LLVMPassManagerRef]
 ffi.lib.LLVMPY_AddDeadStoreEliminationPass.argtypes = [
     ffi.LLVMPassManagerRef]
@@ -883,10 +892,8 @@
 ffi.lib.LLVMPY_AddLoopSimplificationPass.argtypes = [ffi.LLVMPassManagerRef]
 ffi.lib.LLVMPY_AddLoopUnrollPass.argtypes = [ffi.LLVMPassManagerRef]
 ffi.lib.LLVMPY_AddLoopUnrollAndJamPass.argtypes = [ffi.LLVMPassManagerRef]
-ffi.lib.LLVMPY_AddLoopUnswitchPass.argtypes = [
-    ffi.LLVMPassManagerRef,
-    c_bool,
-    c_bool]
+ffi.lib.LLVMPY_AddLoopUnswitchPass.argtypes = [ffi.LLVMPassManagerRef, c_bool,
+                                               c_bool]
 ffi.lib.LLVMPY_AddLowerAtomicPass.argtypes = [ffi.LLVMPassManagerRef]
 ffi.lib.LLVMPY_AddLowerInvokePass.argtypes = [ffi.LLVMPassManagerRef]
 ffi.lib.LLVMPY_AddLowerSwitchPass.argtypes = [ffi.LLVMPassManagerRef]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/llvmlite/tests/test_binding.py 
new/llvmlite-0.43.0/llvmlite/tests/test_binding.py
--- old/llvmlite-0.42.0/llvmlite/tests/test_binding.py  2024-01-31 
16:18:23.000000000 +0100
+++ new/llvmlite-0.43.0/llvmlite/tests/test_binding.py  2024-06-11 
17:24:27.000000000 +0200
@@ -18,6 +18,7 @@
 from llvmlite.binding import ffi
 from llvmlite.tests import TestCase
 
+llvm_version_major = llvm.llvm_version_info[0]
 
 # arvm7l needs extra ABI symbols to link successfully
 if platform.machine() == 'armv7l':
@@ -653,7 +654,7 @@
     def test_rv32d_ilp32(self):
         self.check_riscv_target()
         llmod = self.fpadd_ll_module()
-        target = self.riscv_target_machine(features="+f,+d")
+        target = self.riscv_target_machine(features="+f,+d", abiname="ilp32")
         self.assertEqual(self.break_up_asm(target.emit_assembly(llmod)),
                          riscv_asm_ilp32)
 
@@ -786,9 +787,9 @@
     def test_version(self):
         major, minor, patch = llvm.llvm_version_info
         # one of these can be valid
-        valid = [(14, )]
-        self.assertIn((major,), valid)
-        self.assertIn(patch, range(10))
+        valid = (14, 15)
+        self.assertIn(major, valid)
+        self.assertIn(patch, range(8))
 
     def test_check_jit_execution(self):
         llvm.check_jit_execution()
@@ -2176,7 +2177,8 @@
         pm.add_aggressive_dead_code_elimination_pass()
         pm.add_aa_eval_pass()
         pm.add_always_inliner_pass()
-        pm.add_arg_promotion_pass(42)
+        if llvm_version_major < 15:
+            pm.add_arg_promotion_pass(42)
         pm.add_break_critical_edges_pass()
         pm.add_dead_store_elimination_pass()
         pm.add_reverse_post_order_function_attrs_pass()
@@ -2191,7 +2193,8 @@
         pm.add_loop_simplification_pass()
         pm.add_loop_unroll_pass()
         pm.add_loop_unroll_and_jam_pass()
-        pm.add_loop_unswitch_pass()
+        if llvm_version_major < 15:
+            pm.add_loop_unswitch_pass()
         pm.add_lower_atomic_pass()
         pm.add_lower_invoke_pass()
         pm.add_lower_switch_pass()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/llvmlite-0.42.0/llvmlite/tests/test_refprune.py 
new/llvmlite-0.43.0/llvmlite/tests/test_refprune.py
--- old/llvmlite-0.42.0/llvmlite/tests/test_refprune.py 2024-01-31 
16:18:23.000000000 +0100
+++ new/llvmlite-0.43.0/llvmlite/tests/test_refprune.py 2024-06-11 
17:24:27.000000000 +0200
@@ -521,6 +521,37 @@
         mod, stats = self.check(self.fanout_raise_5)
         self.assertEqual(stats.fanout_raise, 2)
 
+    # test case 6 is from https://github.com/numba/llvmlite/issues/1023
+    fanout_raise_6 = r"""
+define i32 @main(i8* %ptr, i1 %cond1, i1 %cond2, i1 %cond3, i8** %excinfo) {
+bb_A:
+    call void @NRT_incref(i8* %ptr)
+    call void @NRT_incref(i8* %ptr)
+    br i1 %cond1, label %bb_B, label %bb_C
+bb_B:
+    call void @NRT_decref(i8* %ptr)
+    br i1 %cond2, label %bb_D, label %bb_E
+bb_C:
+    store i8* null, i8** %excinfo, !numba_exception_output !0
+    ret i32 1
+bb_D:
+    call void @NRT_decref(i8* %ptr)
+    ret i32 0
+bb_E:
+    call void @NRT_incref(i8* %ptr)
+    br i1 %cond3, label %bb_F, label %bb_C
+bb_F:
+    call void @NRT_decref(i8* %ptr)
+    call void @NRT_decref(i8* %ptr)
+    ret i32 0
+}
+!0 = !{i1 1}
+"""
+
+    def test_fanout_raise_6(self):
+        mod, stats = self.check(self.fanout_raise_6)
+        self.assertEqual(stats.fanout_raise, 7)
+
 
 if __name__ == '__main__':
     unittest.main()

Reply via email to