I Know a Guy Who Knows a Guy: Inlining Indirect Calls in the QWERTY Compiler

Author(s)
Barara, Sarvasv
Editor(s)
Associated Organization(s)
Supplementary to:
Abstract
The advancement of quantum computing has driven the need for effective quantum programming languages and associated intermediate representations. To ensure that these representations are compatible with the broadest range of quantum hardware, it is desirable to attain a straight-line sequence of quantum operations through the transformation of these intermediate representations via optimizations such as inlining. When working with MLIR-based compilation workflows such as ASDF, the compiler for the Qwerty language, it is desirable to convert all indirect calls to direct calls to aid inlining, but it may not be possible in case there are multiple possible targets for the indirect call and the actual target is decided based on a condition evaluated at runtime. While the ASDF compiler possesses a rewrite pattern to push single indirect calls to such conditionally defined functions into the conditional itself, this does not suffice in the case of multiple calls to the same conditional. This thesis proposes various rewrite patterns to help mitigate this issue and presents a theoretical analysis with respect to key metrics such as potential for code explosion, avoidance of redundant calculations, efficiency of IR rewrites and most of all, correctness of the outputted IR. Moreover, the work implements the best canonicalization pattern proposed into ASDF and demonstrates the success of the approach in inlining complex Qwerty programs. Ultimately, this work hopes to allow a larger class of Qwerty programs to target a greater variety of quantum hardware and expand the accessibility of quantum computing, especially in educational contexts.
Sponsor
Date
Extent
Resource Type
Text
Resource Subtype
Undergraduate Research Option Thesis
Rights Statement
Rights URI