Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
3c76e08
Initial proposal for a QsPasses structure
troels-im Jul 20, 2021
9eb5c02
Updating CMake
troels-im Jul 20, 2021
6674e24
Adding CI stuff
troels-im Jul 20, 2021
199eed4
Making CLI interface for CI tasks
troels-im Jul 20, 2021
de323ef
Finishing V1 of CI script with updated clang tidy and format
troels-im Jul 21, 2021
cfb4b93
Refactoring CI module
troels-im Jul 21, 2021
d8949bf
Refactoring
troels-im Jul 21, 2021
cc1a0e6
Removing binary IR
troels-im Jul 21, 2021
1a98e31
Updating gitignore
troels-im Jul 21, 2021
74a4924
Creating root tool for performing CI tasks
troels-im Jul 21, 2021
9841c95
Updating documentation
troels-im Jul 21, 2021
1a5e95f
Refactoring pass
troels-im Jul 21, 2021
f8c7a97
Preparing analysis module
troels-im Jul 21, 2021
87c08b9
Adding a style proposal
troels-im Jul 22, 2021
f095508
Adding style proposal
troels-im Jul 22, 2021
b0c63d6
Updating documentation
troels-im Jul 22, 2021
564f518
Template based pass generator
troels-im Jul 22, 2021
c80fd35
Updating template and writing more documentation
troels-im Jul 22, 2021
3078388
Adding introduction on how to create a pass
troels-im Jul 22, 2021
e975b25
Improving code quality
troels-im Jul 22, 2021
06b09ed
Improving code quality
troels-im Jul 22, 2021
fdb465a
Adding namespaces to passes
troels-im Jul 22, 2021
dd810af
Adding comments to the source
troels-im Jul 22, 2021
db6ab19
Merge branch 'main' into feature/llvm-pass-proposal
troels-im Jul 22, 2021
c40796d
Small refactor
troels-im Jul 22, 2021
a23b6b7
Adding QIR example using opt for optimisation and refactoring library…
troels-im Jul 23, 2021
327ff7f
Adding documentation
troels-im Jul 23, 2021
0ee8249
Updating linter and formatter
troels-im Jul 23, 2021
6c3c896
Updating code to meet PR comments
troels-im Jul 26, 2021
df3e4d2
Adding function analysis template
troels-im Jul 26, 2021
62e64cb
Update of template
troels-im Jul 26, 2021
f0c47f2
Adding boiler plate for const size array analysis
troels-im Jul 26, 2021
49fe601
Adding constant allocation identification
troels-im Jul 26, 2021
cc1a979
Removing garbage
troels-im Jul 26, 2021
7319eb4
Adding slightly harder example
troels-im Jul 26, 2021
c051ee6
Updating with additional example
troels-im Jul 26, 2021
6f34ee8
Adding static analysis for qubit allocation
troels-im Jul 27, 2021
bca2646
Refactoring pass
troels-im Jul 27, 2021
75c22f6
More refactoring
troels-im Jul 27, 2021
ab7ddf6
Adding documenation
troels-im Jul 27, 2021
0ae8d26
CI and style
troels-im Jul 27, 2021
436f544
Adding documentation as per request
troels-im Jul 27, 2021
ee7a097
Minor documentation update
troels-im Jul 27, 2021
162d5ce
Adding lit tests
troels-im Jul 27, 2021
c5a1e84
Finalising expansion pass
troels-im Jul 28, 2021
1866d17
Adding expansion pass to allow allocating arrays statically
troels-im Jul 28, 2021
76a534b
Removing leading % from command line snippets
troels-im Jul 30, 2021
37c6665
Merging 'features/llvm-passes'
troels-im Jul 30, 2021
ae42ad2
Fixing broken things from merge
troels-im Jul 30, 2021
c64bf69
Removing garbage
troels-im Jul 30, 2021
15ff379
WiP replacement pass
troels-im Aug 3, 2021
29b41e0
Creating initial tree matching algorithm
troels-im Aug 3, 2021
ed04613
Finishing access analysis
troels-im Aug 3, 2021
f3f8810
Implementing the replacements
troels-im Aug 4, 2021
6a9fc4b
Tidying code
troels-im Aug 4, 2021
48118db
Finalising refactor
troels-im Aug 4, 2021
9b3bcbd
Fixing bug relating to pattern creation
troels-im Aug 9, 2021
89ac053
Intermediate reorganisation
troels-im Aug 9, 2021
1f35041
Finishing refacto
troels-im Aug 9, 2021
e605c62
Updating PoC
troels-im Aug 9, 2021
921482b
Finishing feasibility
troels-im Aug 9, 2021
1899e41
Improving repository structure and preparing for dual build system su…
troels-im Aug 9, 2021
17bbf79
Adding QAT commandline template
troels-im Aug 9, 2021
946b58d
Restructuring
troels-im Aug 9, 2021
b5b40fb
Finalising refactoring phase 1
troels-im Aug 9, 2021
83cb962
Renaming pass to more suitable name
troels-im Aug 9, 2021
bc4b491
Updating Python tasks
troels-im Aug 9, 2021
788888d
Addingn teleportation example
troels-im Aug 10, 2021
938757b
Fixing include
troels-im Aug 10, 2021
d3485df
Updating replacements
troels-im Aug 10, 2021
c94b548
Finalising positive branching
troels-im Aug 10, 2021
75f0326
Rewriting qubit use analysis
troels-im Aug 10, 2021
c865fcd
Updates to make last bit a transformation work
troels-im Aug 10, 2021
0f56169
Migrating ruleset to shared ptr
troels-im Aug 11, 2021
f1c295d
Refactoring how to define a QIR profile transformation
troels-im Aug 11, 2021
acc3e6d
Fixing merge
troels-im Aug 11, 2021
df87cd1
Removing orig files
troels-im Aug 11, 2021
ecce88f
Removing garbage files
troels-im Aug 11, 2021
85e76b6
Creating prototype QAT
troels-im Aug 11, 2021
c1cebb9
Preparing profile directory
troels-im Aug 12, 2021
c0cb5c0
Adding profile interface
troels-im Aug 12, 2021
b02fed5
Updating CLI
troels-im Aug 12, 2021
7bf5c98
Merge branch 'features/llvm-passes' into feature/profile-pass
troels-im Aug 12, 2021
f72c90c
Fixing profile bug
troels-im Aug 12, 2021
139f3e0
Fixing various bugs
troels-im Aug 12, 2021
c4da2e9
Adding documentation
troels-im Aug 12, 2021
b404a07
Adding additional optimisation
troels-im Aug 12, 2021
fbc81cd
Updating README
troels-im Aug 12, 2021
7c73314
Correcting mistake
troels-im Aug 12, 2021
9f5f5c2
Removing debug output
troels-im Aug 12, 2021
a7467bf
Fixing bug
troels-im Aug 12, 2021
d79d0d7
Documentation and refactoring
troels-im Aug 13, 2021
9604ef6
Refactor location of operands
troels-im Aug 13, 2021
370e8a2
More refactor
troels-im Aug 13, 2021
bdfc6f5
Fixing style
troels-im Aug 13, 2021
09e112f
Fixing CI and style
troels-im Aug 14, 2021
8a58250
Deprecating LL tests
troels-im Aug 14, 2021
b83c3d9
Update src/Passes/README.md
troels-im Aug 16, 2021
c3712a9
Update src/Passes/Source/Rules/OperandPrototype.cpp
troels-im Aug 16, 2021
1941b52
PR revisions
troels-im Aug 16, 2021
0b71eb5
Updating README
troels-im Aug 16, 2021
d324ae4
Updating with review items
troels-im Aug 16, 2021
0f4b921
Updating linux build
troels-im Aug 16, 2021
288abdc
Fixing yaml file
troels-im Aug 16, 2021
51fb281
Removing LLVM 12
troels-im Aug 16, 2021
fad944f
Update src/Passes/Source/Rules/ReplacementRule.hpp
troels-im Aug 16, 2021
c2cbe9a
Update src/Passes/Source/AllocationManager/AllocationManager.hpp
troels-im Aug 16, 2021
b2faa6c
Adding variaous suggestions
troels-im Aug 16, 2021
511baaa
Updating documentation
troels-im Aug 16, 2021
ba69f97
Fixing broken link
troels-im Aug 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions build/passes-linux.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@

steps:
- script: |
sudo apt update -y
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update -y
sudo apt-get install -y
sudo apt-get remove -y llvm-12
sudo apt-get install -y curl pkg-config findutils wget
sudo apt install -y clang-11 cmake clang-format-11 clang-tidy-11
sudo apt-get install -y llvm-11 lldb-11 llvm-11-dev libllvm11 llvm-11-runtime
export CC=clang-11
export CXX=clang++
sudo apt install -y python3 python3-pip
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 0
cd src/Passes/

pip install -r requirements.txt
pip install -r requirements.txt
chmod +x manage
./manage runci
export PYTHONUNBUFFERED=1
export PYTHON_BIN_PATH=/usr/bin/python3
export CC=clang-11
export CXX=clang++-11
./manage runci
displayName: Linux build and CI for passes
30 changes: 18 additions & 12 deletions src/Passes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
cmake_minimum_required(VERSION 3.4.3)

project(Passes)

if (WIN32)
message(STATUS "Adding C:\\Program Files\\LLVM\\lib to LLVM paths")
find_package(LLVM REQUIRED PATHS "C:\\Program Files\\LLVM\\lib" CONFIG )
else()
find_package(LLVM REQUIRED CONFIG)
endif()

project(QirPasses)

find_package(LLVM REQUIRED CONFIG)
include(CheckCXXCompilerFlag)

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
Expand All @@ -32,6 +25,16 @@ if(NOT LLVM_ENABLE_RTTI)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
endif()

# -fvisibility-inlines-hidden is set when building LLVM and on Darwin warnings
# are triggered if llvm-tutor is built without this flag (though otherwise it
# builds fine). For consistency, add it here too.
check_cxx_compiler_flag("-fvisibility-inlines-hidden" SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG)
if(${SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG})
if (${SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG} STREQUAL "1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
endif()
endif()

# We export the compile commands which are needed by clang-tidy
# to run the static analysis
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand All @@ -41,8 +44,11 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include_directories(${LLVM_INCLUDE_DIRS})
link_directories(${LLVM_LIBRARY_DIRS})
add_definitions(${LLVM_DEFINITIONS})
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_SOURCE_DIR}/Source)
llvm_map_components_to_libnames(llvm_libs support core irreader passes orcjit x86asmparser x86codegen x86desc x86disassembler x86info interpreter objcarcopts)


# Adding the libraries
add_subdirectory(libs)
add_subdirectory(tests)
add_subdirectory(Source)
add_subdirectory(tests)

38 changes: 38 additions & 0 deletions src/Passes/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM ubuntu:20.04 as bazel

# basic dependencies -
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y

RUN apt-get install -y curl \
pkg-config \
findutils \
wget

# build dependencies
RUN apt install -y clang-11 cmake clang-format-11 clang-tidy-11 && \
apt-get install -y llvm-11 lldb-11 llvm-11-dev libllvm11 llvm-11-runtime && \
export CC=clang-11 && \
export CXX=clang++

# Python
RUN apt install -y python3 python3-pip && \
update-alternatives --install /usr/bin/python python /usr/bin/python3 0

ADD . /src/
RUN cd /src/ && \
pip install -r requirements.txt && \
chmod +x manage

# running the build
ENV CC=clang-11 \
CXX=clang++-11 \
PYTHONUNBUFFERED=1 \
PYTHON_BIN_PATH=/usr/bin/python3

WORKDIR /src/
RUN export CC=clang-11 && \
export CXX=clang++-11 && \
./manage runci

Loading