Skip to content

✨ MLIR - Conversion from llvm dialect to standard dialects #1120

@li-mingbao

Description

@li-mingbao

Problem Statement

Once #1091 is merged, there will be a conversion from QIR in the llvm dialect into the mqtref dialect. During this conversion however only quantum operations are converted and other standard operation such as llvm.constant and llvm.func are not converted. While there are built-in transformation passes from higher level standard dialects such as arith or func to llvm there no conversion passes in the other direction.

This is not an issue for the conversion itself, but this could cause some issues later on during the transformation passes as they would expect an operation from a standard dialect and not from the llvm dialect.

Proposed Solution

The best solution would be to create a new conversion pass that converts llvm operations to std dialects operations. Looking at the documentation of the llvm dialect, there are probably a bunch of operations that do not need to be converted but atleast the standard operations that are likely to appear in QIR code and are required for the transformation passes need to be converted.
These are for example llvm.constant, llvm.cond_br or llvm.func.

Metadata

Metadata

Assignees

No one assigned

    Labels

    MLIRAnything related to MLIRc++Anything related to C++ codeenhancementImprovement of existing feature

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions