qir-alliance / pyqir

PyQIR is a set of APIs for generating, parsing, and evaluating Quantum Intermediate Representation (QIR).
https://qir-alliance.github.io/pyqir
MIT License
54 stars 24 forks source link

Get building on LLVM 18.1 (...But not working) #278

Closed ausbin closed 1 month ago

ausbin commented 1 month ago

Rough work on upgrading to LLVM 18.1.6 (#224). This builds, but the tests definitely do not pass (some segfault, actually). So this should not be merged into main in its current state, but I'm putting this up if it saves someone some time.

I built this with the following in pyqir/:

$ pip install -v --config-settings=build-args='-F qirlib/llvm18-1 -F pyqir/llvm18-1' .[test]

(I did not use the PowerShell build script.)

Remaining Problems

If y'all are interested, I can continue working on this and get the tests to pass.

One thing that seems particularly nasty at the moment is how to handle Builder.call(). I can think of two options:

  1. Modify the signature of Builder.call() to also take a Type (looks like that already exists in types.rs). This is backwards incompatible
  2. Modify Value to also hold an LLVMType. (This may quickly become burdensome to support in future usecases, but it would probably be a simpler user-facing API)

What do y'all think? And are there plans to upgrade LLVM at all?

ausbin commented 1 month ago

Just stumbled upon this: https://github.com/qir-alliance/pyqir/blob/c02430a5d4f566425f6112576d4109071011ea66/qirlib/src/types.rs#L43. That will need to get fixed too

ausbin commented 1 month ago

I'm getting the vibe that it is not helpful for me to continue working on this, closing