Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move llvmlite to llvm19 #1092

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Move llvmlite to llvm19 #1092

wants to merge 20 commits into from

Conversation

yashssh
Copy link
Contributor

@yashssh yashssh commented Oct 25, 2024

Depends and contains changes introduced with #1091

List of changes in this MR

  • Delete legacy pass manager code
  • Delete typed pointer code
  • Update APIs that needs updating for llvm19
  • Update refprune pass and its tests

TODO:

  • run with remarks feature and pass timer features have to be added

yashssh and others added 20 commits August 22, 2024 12:43
Add todo for future passes, simplify pass registeration in newpassmanager.py

add dot printer passes

Add hooks for most of the passes currently supported by legacy pm

edit
Drop support for typed pointers
Drop support for Legacy pass managers
Update some APIs
- Delete transforms.{py|cpp}
- Drop support for llvm version < 17
- Refactoring
- Fix some deprecated APIs
- Disable some refprune tests, either the tests or the pass itself needs updating for llvm18
- Update few APIs
Add todo for future passes, simplify pass registeration in newpassmanager.py

Add dot printer passes

Add hooks for most of the passes currently supported by legacy pm

Fix working of new APIs with llvm16
@gmarkall
Copy link
Member

gmarkall commented Nov 5, 2024

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

auto context = LLVMGetGlobalContext();
LLVMContextSetOpaquePointers(context, enableOpaquePointers);
// Opaque pointer support dropped https://reviews.llvm.org/D139441
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you meant "Typed pointer support dropped"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, thanks for spotting! Will update :)

LLVMContextRef context = LLVMContextCreate();
LLVMContextSetOpaquePointers(context, enableOpaquePointers);
// Opaque pointer support dropped https://reviews.llvm.org/D139441
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Same as above.)

@detrout
Copy link

detrout commented Mar 3, 2025

Hi,

I found time to try and work on getting llvmlite to build with a version of llvm that's in Debian.

I took this pull request and rebased it against 0.44.0, and then collapse the branch into a single diff to apply to the a Debian 0.44.0 version of the llvmlite package.

I pushed what I've manage to get done to https://github.com/detrout/llvmlite/tree/llvm19

I noticed there's a bunch of code removed this pull request in a migration from passmanager to newpassmanager, though the llvmlite HEAD branch currently has both passmanager and newpassmanager modules. I don't know if it's intended to remove passmanager or not?

The merged code almost works (at least on Debian unstable on a x86 cpu with python 3.13.2 and llvm-19.1.7) it's down to two test failures.

======================================================================             
FAIL: test_object_file (llvmlite.tests.test_binding.TestObjectFile.test_object_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_llvmlite/build/llvmlite/tests/test_binding.py", line 2443, in test_object_file
    self.assertTrue(s.size() > 0)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
AssertionError: False is not true
                               
======================================================================
FAIL: test_lookup_current_process_symbol_fails (llvmlite.tests.test_binding.TestOrcLLJIT.test_lookup_current_process_symbol_fai
ls)                  
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_llvmlite/build/llvmlite/tests/test_binding.py", line 1493, in test_lookup_curre
nt_process_symbol_fails                                        
    with self.assertRaisesRegex(RuntimeError, msg):
         ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
AssertionError: RuntimeError not raised
                                                                                                                               
----------------------------------------------------------------------
Ran 379 tests in 7.699s

FAILED (failures=2, skipped=2)

I did try running the build under arm64 using qemu and funny story, all the tests passed.

Ran 379 tests in 171.947s
                               
OK (skipped=19) 

@detrout
Copy link

detrout commented Mar 3, 2025

I'd also managed to run the two test failures in pdb, and for the llvmlite.tests.test_binding.TestObjectFile.test_object_file

I found a possibly useful thing that there was a .text segment that had no contents. Though there were other text segments like (I think) .ltext that had some contents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants