Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

QIR test files should be generated automatically  #498

@IrinaYatsenko

Description

@IrinaYatsenko

Currently the input QIR files for tests in QirRuntime are generated manually and have to be doctored before they can be used. This creates a maintenance burden and a possibility of drift between the intended Q# input and the actual QIR input for the tests.

Step 1: remove the necessity to post-edit QIR input
Reasons for post-editing of the QIR files:

  1. they might contain calls to non-implemented runtime callbacks even if these calls are never executed by the QIR
  2. there might contain duplicated symbol definitions for partial applications and memory management functions
  3. they do contain duplicated symbol definitions for PauliX constants

To address the above we could:

  1. fix the corresponding bugs in the compiler so it doesn't generate unnecessary code and/or add stubs in the runtime to enable linking
  2. (and 3.) compile all input Q# files into a single *.ll file (we will still have manually authored test .ll files but these we can create in a way that avoids naming conflicts). To be able to do this before multiple entry points are supported by Q# compiler, might need to modify the tests to use C-compatible signatures so wouldn't need to C-compatible wrapper provided by @EntryPoint attribute

Step 2: enable QirRuntime project to consume Q# compiler as a package and incorporate QIR generation into the build process (probably in the form of custom CMake actions). Note: this should also remove the need for maintaining QirCore.qs and QirTarget.qs in the runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions