https://github.com/epiqc/ScaffCC
Tip revision: 861c8b60980b0f4d36b101b45346a2e64b0fa390 authored by Pranav Gokhale on 05 February 2018, 05:29:11 UTC
update documentation and release notes
update documentation and release notes
Tip revision: 861c8b6
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}