https://github.com/epiqc/ScaffCC
Tip revision: c89857074e85d3e843cda9f33a19a30808b40c06 authored by EPiQC on 08 July 2019, 18:49:30 UTC
Merge pull request #36 from AndrewLitteken/ScaffCC_OSX
Merge pull request #36 from AndrewLitteken/ScaffCC_OSX
Tip revision: c898570
chapter-expand.tex
\chapter{Expanding ScaffCC}\label{ch:expand}
ScaffCC is completely open-source and may be expanded to accomodate future needs of quantum circuit analysis and optimization.
At the core of ScaffCC are the LLVM compiler passes, which operate on LLVM IR (.ll) code. All LLVM passes are stored in:
\begin{lstlisting}
llvm/lib/Transforms/
\end{lstlisting}
Passes specific to ScaffCC are stored in:
\begin{lstlisting}
llvm/lib/Transforms/Scaffold
\end{lstlisting}
In general, to run a pass in LLVM, you invoke the opt program as follows:
\begin{lstlisting}
build/Release+Asserts/bin/opt -S -load build/Release+Asserts/lib/Scaffold.so {pass_name} {input_ll_file} > {output_ll_file} 2> {log_file}
\end{lstlisting}
Note that ${pass\_name}$ referes to the unique name of the pass by which it is registered in the LLVM system, by invoking the following in the implementation of the pass:
\begin{lstlisting}
static RegisterPass<{pass_name}> X({pass_name}, {description_of_functionality});
\end{lstlisting}
To write a new pass, start by looking at the previously implemented examples in this directory, and consulting the LLVM Documentation:
\url{http://llvm.org/docs/WritingAnLLVMPass.html}