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

Add LLVM Opaque Pointer Support #224

Open idavis opened 1 year ago

idavis commented 1 year ago
Once Opaque Pointers in QIR is resolved, the deprecated calls need to be replaced with the new versions: Old Name New Name
LLVMBuildLoad LLVMBuildLoad2
LLVMBuildCall LLVMBuildCall2
LLVMBuildInvoke LLVMBuildInvoke2
LLVMBuildGEP LLVMBuildGEP2
LLVMBuildInBoundsGEP LLVMBuildInBoundsGEP2
LLVMBuildStructGEP LLVMBuildStructGEP2
LLVMBuildPtrDiff LLVMBuildPtrDiff2
LLVMConstGEP LLVMConstGEP2
LLVMConstInBoundsGEP LLVMConstInBoundsGEP2
LLVMAddAlias LLVMAddAlias2

In preparation for this, we need to move PyQIR to LLVM 16 which should allow working with modules that can use both typed and opaque pointers. This should give us a working base from which others can migrate their tooling to support opaque pointers. We will need to design an API that allows us to turn on/off opaque pointers and use the appropriate LLVM calls depending on which API is being used.