├── .gitignore
├── LICENSE
├── README.md
├── Vagrantfile
├── compiler
├── CMakeLists.txt
├── LICENSE.TXT
├── Makefile
├── README.txt
└── projects
│ ├── CMakeLists.txt
│ ├── include
│ ├── DAE
│ │ └── Utils
│ │ │ └── SkelUtils
│ │ │ └── headers.h
│ ├── SWOOP
│ │ └── Transform
│ │ │ └── SwoopDAE
│ │ │ └── BasicSwoop.h
│ └── Util
│ │ ├── Analysis
│ │ ├── AliasUtils.h
│ │ ├── LoopCarriedDependencyAnalysis.h
│ │ └── LoopDependency.h
│ │ ├── Annotation
│ │ └── MetadataInfo.h
│ │ ├── DAE
│ │ └── DAEUtils.h
│ │ └── Transform
│ │ └── BranchMerge
│ │ └── BranchMerge.h
│ └── src
│ ├── CMakeLists.txt
│ ├── DAE
│ ├── CMakeLists.txt
│ └── Utils
│ │ ├── CMakeLists.txt
│ │ ├── LoopExtract
│ │ ├── CMakeLists.txt
│ │ └── LoopExtract.cpp
│ │ └── SkelUtils
│ │ ├── LoopUtils.cpp
│ │ └── Utils.cpp
│ ├── SWOOP
│ ├── CMakeLists.txt
│ ├── Transform
│ │ ├── CMakeLists.txt
│ │ ├── OptimisticSwoop
│ │ │ ├── CMakeLists.txt
│ │ │ └── OptimisticSwoop.cpp
│ │ ├── PhaseStitching.cpp
│ │ ├── PhaseStitching.h
│ │ └── SwoopDAE
│ │ │ ├── CMakeLists.txt
│ │ │ ├── FindInstructions.cpp
│ │ │ ├── FindInstructions.h
│ │ │ ├── LCDHandler.cpp
│ │ │ ├── LCDHandler.h
│ │ │ └── SwoopDAE.cpp
│ └── Utils
│ │ ├── CMakeLists.txt
│ │ ├── DCEutils.cpp
│ │ ├── LongLatency.cpp
│ │ └── MarkLoopsToSwoopify
│ │ ├── CMakeLists.txt
│ │ └── MarkLoopsToSwoopify.cpp
│ └── Util
│ ├── Analysis
│ ├── AliasUtils.cpp
│ ├── BasicLCDAnalysis.cpp
│ ├── LoopDependency.cpp
│ └── MarkLCD.cpp
│ ├── Annotation
│ ├── BranchAnnotate
│ │ ├── CMakeLists.txt
│ │ ├── Replace.cpp
│ │ └── SBPAnnotator.cpp
│ ├── CFGIndirectionCount
│ │ ├── CFGIndirectionCount.cpp
│ │ └── CMakeLists.txt
│ ├── CMakeLists.txt
│ └── MetadataInfo.cpp
│ ├── CMakeLists.txt
│ ├── DAE
│ └── DAEUtils.cpp
│ ├── Loops
│ ├── CMakeLists.txt
│ └── ForcedLoopUnroll.cpp
│ └── Transform
│ └── BranchMerge
│ └── BranchMerge.cpp
├── experiments
└── swoop
│ └── sources
│ ├── Makefile
│ ├── common
│ ├── Makefile.environment
│ └── SWOOP
│ │ ├── Makefile.defaults
│ │ └── Makefile.targets
│ └── myBenchmark
│ └── src
│ ├── Makefile
│ └── small_benchmark.cpp
└── setup.sh
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | #==============================================================================#
3 | # Directories to ignore (do not add trailing '/'s, they skip symlinks).
4 | #==============================================================================#
5 | # Build directory
6 | build
7 |
8 | #==============================================================================#
9 | # File extensions to be ignored anywhere in the tree.
10 | #==============================================================================#
11 | # Temp files created by most text editors.
12 | *~
13 | \#*
14 | # Merge files created by git.
15 | *.orig
16 | # Byte compiled python modules.
17 | *.pyc
18 | # vim swap files
19 | .*.swp
20 | .sw?
21 | #OS X specific files.
22 | .DS_store
23 |
24 |
25 | *.ll
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Eta Scale Open Source License
2 |
3 | By accessing or using the software that is licensed under the terms of this
4 | document ("Eta Scale Software") in any form you expressly undertake to be bound
5 | by these license terms. If you use the code on behalf of a business, you agree
6 | to these license terms both in person and on behalf of that business and you
7 | represent that you have the authority to do so.
8 |
9 | 1) Alternative License
10 |
11 | Eta Scale Software is distributed under a dual-license scheme,
12 | an open source license for academic research and a commercial license
13 | for any commercial setting or commercial application.
14 | This document is the open source license for academic research.
15 |
16 | If you are interested in the commercial license, please contact
17 | Eta Scale AB by email: contact@etascale.com
18 |
19 | 2) No warranties
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24 | PARTICULAE PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
25 | SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
26 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
31 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | POSSIBILITY OF SUCH DAMAGE.
33 |
34 | 3) Copyleft for Software Distribution
35 |
36 | Redistribution and use in source and binary forms, with or without
37 | modification, are permitted provided that the following conditions
38 | are met:
39 |
40 | Redistributions of source code must retain all conditions of the
41 | Eta Scale Open Source License. Redistributions in binary form must
42 | reproduce the terms of the Eta Scale Open Source License in the
43 | documentation and/or other materials provided with the distribution.
44 | Neither redistributions in source code or in binary form may impose
45 | any further restrictions on the exercise of the rights granted or
46 | affirmed under the Eta Scale Open Source License.
47 |
48 | Redistributions in any form must be accompanied by information on how to
49 | obtain complete source code for the Eta Scale Software and any
50 | accompanying software that uses the Eta Scale Software. The source code
51 | must either be included in the distribution or be available for no
52 | more than the cost of distribution. For an executable file, complete
53 | source code means the source code for all modules it contains. It does
54 | not include source code for modules or files that typically accompany
55 | the major components of the operating system on which the executable
56 | file runs.
57 |
58 | Neither the name Eta Scale, nor the names of any of its projects or
59 | contributors may be used to endorse or promote products derived from
60 | Eta Scale Software without specific prior written permission.
61 |
62 | 4) Copyleft for Software Users
63 |
64 | Notwithstanding any other provision of the Eta Scale Open Source
65 | License, if you modify the Eta Scale Software, your modified version
66 | must prominently offer all users interacting with it an opportunity to
67 | receive the corresponding source code of your version.
68 | If the interaction happens remotely through a computer network (if
69 | your version supports such interaction) an opportunity to receive the
70 | corresponding source code of your version by providing access to the
71 | corresponding source code from a network server at no charge, through
72 | some standard or customary means of facilitating copying of software.
73 |
74 | 5) License for Contributions
75 |
76 | For any of your modifications or other derivations of the Eta Scale
77 | Software source code ("your Contributions"), you grant Eta Scale AB a
78 | non-exclusive, irrevocable, worldwide, no-charge, transferable license
79 | to use, execute, create derivative works of, and distribute
80 | (internally and externally) or otherwise use commercially or
81 | non-commercially your Contributions, in any form (including, but not
82 | limited to binary and source code forms).
83 | Except for the rights granted to Eta Scale AB in this paragraph, you
84 | reserve all rights, title and interest in and to your Contributions.
85 |
86 | 6) Non-Severability of the Eta Scale Open Source License
87 |
88 | If any part of the Eta Scale Open Source License is invalid, or becomes
89 | invalid, then the entire license shall become invalid, and any rights
90 | you derived from the Eta Scale Open Source License shall be null and
91 | void. This shall not affect the License for your Contributions that you
92 | have given according to Section 5 of the Eta Scale Open Source License,
93 | which shall remain valid even if the Eta Scale Open Source License
94 | itself is invalid, or becomes invalid.
95 |
96 | 7) Choice of Law
97 |
98 | This license shall be governed by the laws of Sweden, excluding choice
99 | of law provisions.
100 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Clairvoyance
2 |
3 | Clairvoyance1 provides passes for instruction scheduling targeting long latency loads.
4 | It is currently being developed at Uppsala University.
5 |
6 | More infos to come.
7 |
8 | [1] Clairvoyance: Look-ahead Compile-Time Scheduling
9 |
10 |
--------------------------------------------------------------------------------
/Vagrantfile:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | # All Vagrant configuration is done below. The "2" in Vagrant.configure
5 | # configures the configuration version (we support older styles for
6 | # backwards compatibility). Please don't change it unless you know what
7 | # you're doing.
8 | Vagrant.configure("2") do |config|
9 | # The most common configuration options are documented and commented below.
10 | # For a complete reference, please see the online documentation at
11 | # https://docs.vagrantup.com.
12 |
13 | # Every Vagrant development environment requires a box. You can search for
14 | # boxes at https://atlas.hashicorp.com/search.
15 | config.vm.box = "bento/ubuntu-16.04"
16 |
17 | # Disable automatic box update checking. If you disable this, then
18 | # boxes will only be checked for updates when the user runs
19 | # `vagrant box outdated`. This is not recommended.
20 | # config.vm.box_check_update = false
21 |
22 | # Create a forwarded port mapping which allows access to a specific port
23 | # within the machine from a port on the host machine. In the example below,
24 | # accessing "localhost:8080" will access port 80 on the guest machine.
25 | # config.vm.network "forwarded_port", guest: 80, host: 8080
26 |
27 | # Create a private network, which allows host-only access to the machine
28 | # using a specific IP.
29 | # config.vm.network "private_network", ip: "192.168.33.10"
30 |
31 | # Create a public network, which generally matched to bridged network.
32 | # Bridged networks make the machine appear as another physical device on
33 | # your network.
34 | # config.vm.network "public_network"
35 |
36 | # Share an additional folder to the guest VM. The first argument is
37 | # the path on the host to the actual folder. The second argument is
38 | # the path on the guest to mount the folder. And the optional third
39 | # argument is a set of non-required options.
40 | # config.vm.synced_folder "../data", "/vagrant_data"
41 |
42 | # Provider-specific configuration so you can fine-tune various
43 | # backing providers for Vagrant. These expose provider-specific options.
44 | # Example for VirtualBox:
45 | #
46 | config.vm.provider "virtualbox" do |vb|
47 | # # Display the VirtualBox GUI when booting the machine
48 | # vb.gui = true
49 |
50 | # # Customize the amount of memory on the VM:
51 | vb.memory = 4096
52 | vb.cpus = 2
53 | end
54 | #
55 | # View the documentation for the provider you are using for more
56 | # information on available options.
57 |
58 | # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
59 | # such as FTP and Heroku are also available. See the documentation at
60 | # https://docs.vagrantup.com/v2/push/atlas.html for more information.
61 | # config.push.define "atlas" do |push|
62 | # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
63 | # end
64 |
65 | # Enable provisioning with a shell script. Additional provisioners such as
66 | # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
67 | # documentation for more information about their specific syntax and use.
68 | # config.vm.provision "shell", inline: <<-SHELL
69 | # apt-get update
70 | # apt-get install -y apache2
71 | # SHELL
72 |
73 | config.vm.provision :shell, :path => "setup.sh"
74 | end
75 |
--------------------------------------------------------------------------------
/compiler/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) Eta Scale AB. Licensed under the Eta Scale Open Source License. See the LICENSE file for details.
2 |
3 | #------------------------------------------------------------------------------
4 | # CMakeLists.txt
5 | #------------------------------------------------------------------------------
6 | # This file was taken and adapted from a tutorial at the Imperial College London
7 | #
8 | # [1] https://github.com/delcypher/srg-llvm-pass-tutorial
9 | #
10 | cmake_minimum_required(VERSION 2.8.12)
11 |
12 | #------------------------------------------------------------------------------
13 | # FindLLVM
14 | #------------------------------------------------------------------------------
15 | # If building against a locally built version of LLVM (this must be built with
16 | # CMake not and not the Autoconf/Makefile build system) you need to set the
17 | # LLVM_DIR cache variable that find_package(LLVM ...) introduces.
18 | # E.g.
19 | # cmake -DLLVM_DIR:PATH=/path/to/llvm/build/share/llvm/cmake /path/to/this_projects_source_directory
20 | find_package(LLVM REQUIRED)
21 |
22 | message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
23 |
24 | if ( "${LLVM_PACKAGE_VERSION}" VERSION_LESS "3.5" )
25 | message(FATAL_ERROR "Need LLVM >=3.5")
26 | endif()
27 |
28 | include_directories("${LLVM_INCLUDE_DIRS}")
29 | message(STATUS "LLVM_INCLUDE_DIRS is ${LLVM_INCLUDE_DIRS}")
30 |
31 | message(STATUS "LLVM_TOOLS_BINARY_DIR is ${LLVM_TOOLS_BINARY_DIR}")
32 |
33 | #------------------------------------------------------------------------------
34 | # Set compiler flags
35 | #------------------------------------------------------------------------------
36 | # This unfortunately doesn't add much
37 | add_definitions(${LLVM_DEFINITIONS})
38 |
39 | include(CheckCXXCompilerFlag)
40 | macro(add_cxx_flag flag name)
41 | CHECK_CXX_COMPILER_FLAG(${flag} "${name}_SUPPORTED")
42 | if("${name}_SUPPORTED")
43 | add_definitions(${flag})
44 | else()
45 | message(FATAL_ERROR "${flag} flag is not supported by ${CMAKE_CXX_COMPILER}")
46 | endif()
47 | endmacro()
48 |
49 | # FIXME: Setting flags this way isn't very portable
50 | if (NOT LLVM_ENABLE_RTTI)
51 | message(STATUS "LLVM was built without RTTI, so we must disable it too for linking to work properly")
52 | add_cxx_flag(-fno-rtti RTTI) # Can't use LLVMSupport properly if we have rtti
53 | endif()
54 | add_cxx_flag(-std=c++11 CXX11)
55 |
56 | #------------------------------------------------------------------------------
57 | # Handy macro to copy files matching a globbing pattern in the current source
58 | # source directory to the current build directory
59 | #------------------------------------------------------------------------------
60 | macro(copy_files_to_build_dir GLOBS)
61 | file(GLOB ABSOLUTE_PATH_TO_FILES_TO_COPY ${ARGV})
62 |
63 | foreach(file ${ABSOLUTE_PATH_TO_FILES_TO_COPY})
64 | get_filename_component(filename ${file} NAME)
65 | configure_file(${filename} ${filename} COPYONLY)
66 | endforeach()
67 | endmacro()
68 |
69 | #------------------------------------------------------------------------------
70 | # Warn if clang is not available
71 | #------------------------------------------------------------------------------
72 | if (NOT EXISTS "${LLVM_TOOLS_BINARY_DIR}/clang")
73 | message(WARNING "Clang was not found in LLVM_TOOLS_BINARY_DIR. Many of the demo scripts won't work without this")
74 | endif()
75 |
76 | #------------------------------------------------------------------------------
77 | # Manage library output directories
78 | #------------------------------------------------------------------------------
79 |
80 | set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib )
81 | set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib )
82 |
83 | #------------------------------------------------------------------------------
84 | # Projects
85 | #------------------------------------------------------------------------------
86 |
87 | add_subdirectory(projects)
88 | # add_subdirectory(tools) # remove for artifact evaluation
89 |
--------------------------------------------------------------------------------
/compiler/LICENSE.TXT:
--------------------------------------------------------------------------------
1 | ==============================================================================
2 | LLVM Release License
3 | ==============================================================================
4 | University of Illinois/NCSA
5 | Open Source License
6 |
7 | Copyright (c) 2003-2015 University of Illinois at Urbana-Champaign.
8 | All rights reserved.
9 |
10 | Developed by:
11 |
12 | LLVM Team
13 |
14 | University of Illinois at Urbana-Champaign
15 |
16 | http://llvm.org
17 |
18 | Permission is hereby granted, free of charge, to any person obtaining a copy of
19 | this software and associated documentation files (the "Software"), to deal with
20 | the Software without restriction, including without limitation the rights to
21 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
22 | of the Software, and to permit persons to whom the Software is furnished to do
23 | so, subject to the following conditions:
24 |
25 | * Redistributions of source code must retain the above copyright notice,
26 | this list of conditions and the following disclaimers.
27 |
28 | * Redistributions in binary form must reproduce the above copyright notice,
29 | this list of conditions and the following disclaimers in the
30 | documentation and/or other materials provided with the distribution.
31 |
32 | * Neither the names of the LLVM Team, University of Illinois at
33 | Urbana-Champaign, nor the names of its contributors may be used to
34 | endorse or promote products derived from this Software without specific
35 | prior written permission.
36 |
37 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
39 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
40 | CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
42 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
43 | SOFTWARE.
44 |
45 | ==============================================================================
46 | Copyrights and Licenses for Third Party Software Distributed with LLVM:
47 | ==============================================================================
48 | The LLVM software contains code written by third parties. Such software will
49 | have its own individual LICENSE.TXT file in the directory in which it appears.
50 | This file will describe the copyrights, license, and restrictions which apply
51 | to that code.
52 |
53 | The disclaimer of warranty in the University of Illinois Open Source License
54 | applies to all code in the LLVM Distribution, and nothing in any of the
55 | other licenses gives permission to use the names of the LLVM Team or the
56 | University of Illinois to endorse or promote products derived from this
57 | Software.
58 |
59 | The following pieces of software have additional or alternate copyrights,
60 | licenses, and/or restrictions:
61 |
62 | Program Directory
63 | ------- ---------
64 | Autoconf llvm/autoconf
65 | llvm/projects/ModuleMaker/autoconf
66 | Google Test llvm/utils/unittest/googletest
67 | OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex}
68 | pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT}
69 | ARM contributions llvm/lib/Target/ARM/LICENSE.TXT
70 | md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h
71 |
--------------------------------------------------------------------------------
/compiler/Makefile:
--------------------------------------------------------------------------------
1 | # Copyright (C) Eta Scale AB. Licensed under the Eta Scale Open Source License. See the LICENSE file for details.
2 |
3 | #------------------------------------------------------------------------------
4 | # Makefile
5 | #------------------------------------------------------------------------------
6 | # Building the swoop project
7 | #
8 | COMPILER_DIR=$(shell pwd)
9 | BUILD_DIR=$(COMPILER_DIR)/build
10 |
11 | LLVM_DIR=$(COMPILER_DIR)/llvm
12 | LLVM_BUILD_DIR=$(BUILD_DIR)/llvm-build
13 | LLVM_LIB_DIR=$(LLVM_BUILD_DIR)/lib
14 | LLVM_BUILD_MAKEFILE=$(LLVM_BUILD_DIR)/Makefile
15 | LLVM_CMAKE_PATH=$(LLVM_BUILD_DIR)/share/llvm/cmake/
16 |
17 | CLANG_LIB=$(LLVM_LIB_DIR)/libclang.so
18 |
19 | BUILD_TYPE?=MinSizeRel
20 |
21 | GIT_MAJOR:=$(shell git --version | cut -d ' ' -f 3 | cut -d '.' -f 1)
22 | ifeq ($(shell test $(GIT_MAJOR) -ge 2; echo $$?),0)
23 | GIT_SHALLOW=1
24 | else
25 | GIT_SHALLOW=0
26 | endif
27 |
28 | #------------------------------------------------------------------------------
29 | # LLVM tools: Clang, Compiler-rt
30 | #------------------------------------------------------------------------------
31 | #
32 |
33 | LLVM_REPOSITORY=https://github.com/llvm-mirror/llvm.git
34 | LLVM_RELEASE=release_38
35 |
36 | LLVM_TOOLS=$(LLVM_DIR)/tools
37 | CLANG=$(LLVM_TOOLS)/clang
38 | CLANG_REPOSITORY=http://llvm.org/git/clang.git
39 |
40 | LLVM_PROJECTS=$(LLVM_DIR)/projects
41 | COMPILER_RT=$(LLVM_PROJECTS)/compiler-rt
42 | COMPILER_RT_REPOSITORY=http://llvm.org/git/compiler-rt.git
43 |
44 | OMP=$(LLVM_PROJECTS)/openmp
45 | OMP_REPOSITORY=https://github.com/llvm-mirror/openmp.git
46 |
47 | TOOL_RELEASE=release_38
48 |
49 | #------------------------------------------------------------------------------
50 | # Projects
51 | #------------------------------------------------------------------------------
52 | #
53 | PROJECTS_DIR=$(COMPILER_DIR)
54 | PROJECTS_BUILD_DIR=$(BUILD_DIR)/projects-build
55 | PROJECTS_BUILD_MAKEFILE=$(PROJECTS_BUILD_DIR)/Makefile
56 |
57 | #------------------------------------------------------------------------------
58 | # OTHERS
59 | #------------------------------------------------------------------------------
60 | #
61 |
62 | all: $(PROJECTS_BUILD_MAKEFILE)
63 | $(MAKE) -C $(PROJECTS_BUILD_DIR)
64 |
65 | $(CLANG_LIB): $(LLVM_BUILD_MAKEFILE)
66 | $(MAKE) -C $(LLVM_BUILD_DIR)
67 |
68 | $(LLVM_BUILD_MAKEFILE): $(LLVM_DIR)/Makefile $(CLANG) $(COMPILER_RT) $(OMP)
69 | mkdir -p $(LLVM_BUILD_DIR)
70 | cd $(LLVM_BUILD_DIR); cmake -D CMAKE_BUILD_TYPE=$(BUILD_TYPE) -DLLVM_BINUTILS_INCDIR=/usr/include $(LLVM_DIR);
71 |
72 | $(LLVM_DIR)/Makefile:
73 | ifeq ($(GIT_SHALLOW),1)
74 | # # Disable shallow cloning of a specific version
75 | # # This should be fixed with Git 2.5+
76 | # # From http://stackoverflow.com/a/30701724 http://stackoverflow.com/questions/14872486/pull-a-specific-commit-from-a-remote-git-repository
77 | git clone -b $(LLVM_RELEASE) --depth 1 $(LLVM_REPOSITORY) $(LLVM_DIR);
78 | # # From http://stackoverflow.com/questions/3489173/how-to-clone-git-repository-with-specific-revision-changeset
79 | # mkdir $(LLVM_DIR)
80 | # git init $(LLVM_DIR)
81 | # git --git-dir=$(LLVM_DIR)/.git --work-tree=$(LLVM_DIR) remote add origin $(LLVM_REPOSITORY)
82 | # git --git-dir=$(LLVM_DIR)/.git --work-tree=$(LLVM_DIR) fetch --depth 1 origin $(LLVM_RELEASE)
83 | # git --git-dir=$(LLVM_DIR)/.git --work_tree=$(LLVM_DIR) reset --hard FETCH_HEAD
84 | else
85 | git clone $(LLVM_REPOSITORY) $(LLVM_DIR) -b $(LLVM_RELEASE);
86 | endif
87 |
88 | $(CLANG): $(LLVM_DIR)/CMakeLists.txt
89 | ifeq ($(GIT_SHALLOW),1)
90 | cd $(LLVM_TOOLS); git clone -b $(TOOL_RELEASE) --depth 1 $(CLANG_REPOSITORY);
91 | else
92 | cd $(LLVM_TOOLS); git clone $(CLANG_REPOSITORY) -b $(TOOL_RELEASE);
93 | endif
94 |
95 | $(COMPILER_RT): $(LLVM_DIR)/CMakeLists.txt
96 | ifeq ($(GIT_SHALLOW),1)
97 | cd $(LLVM_PROJECTS); git clone -b $(TOOL_RELEASE) --depth 1 $(COMPILER_RT_REPOSITORY);
98 | else
99 | cd $(LLVM_PROJECTS); git clone $(COMPILER_RT_REPOSITORY) -b $(TOOL_RELEASE);
100 | endif
101 |
102 | $(OMP): $(LLVM_DIR)/CMakeLists.txt
103 | ifeq ($(GIT_SHALLOW),1)
104 | cd $(LLVM_PROJECTS); git clone -b $(TOOL_RELEASE) --depth 1 $(OMP_REPOSITORY);
105 | else
106 | cd $(LLVM_PROJECTS); git clone $(OMP_REPOSITORY) -b $(TOOL_RELEASE);
107 | endif
108 |
109 |
110 | $(PROJECTS_BUILD_MAKEFILE): $(CLANG_LIB)
111 | mkdir -p $(PROJECTS_BUILD_DIR)
112 | cd $(PROJECTS_BUILD_DIR); cmake -DLLVM_DIR:STRING=$(LLVM_CMAKE_PATH) -D CMAKE_BUILD_TYPE=$(BUILD_TYPE) -DLLVM_TARGETS_TO_BUILD=$(TARGETS_TO_BUILD) $(PROJECTS_DIR);
113 | clean:
114 | rm -rf $(PROJECTS_BUILD_DIR)
115 |
116 | veryclean:
117 | rm -rf $(BUILD_DIR)
118 |
--------------------------------------------------------------------------------
/compiler/README.txt:
--------------------------------------------------------------------------------
1 | # Copyright (C) Eta Scale AB. Licensed under the Eta Scale Open Source License. See the LICENSE file for details.
2 |
3 | Compiler Repository
4 |
5 | Installation
6 | ------------
7 | Run:
8 | make
9 |
10 | Running make will generate a separate build directory that
11 | contains all binaries for llvm and the projects.
12 |
13 | Packages
14 | --------
15 | o llvm - llvm source code
16 | o projects - llvm passes for different projects
17 |
18 | Other
19 | -------
20 | o setup.sh - for build system (ignore)
21 | o package.sh - for build system (ignore)
22 |
23 | Contact
24 | -------
25 | Kim-Anh Tran : kim-anh.tran@it.uu.se
26 |
--------------------------------------------------------------------------------
/compiler/projects/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | # Copyright (C) Eta Scale AB. Licensed under the Eta Scale Open Source License. See the LICENSE file for details.
3 | set(PROJECTS_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
4 | set(PROJECTS_MAIN_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
5 |
6 | include_directories(${PROJECTS_MAIN_INCLUDE_DIR})
7 |
8 | add_subdirectory(src)
9 |
--------------------------------------------------------------------------------
/compiler/projects/include/DAE/Utils/SkelUtils/headers.h:
--------------------------------------------------------------------------------
1 | //===- headers.h - General includes for DAE ---------- --------------------===//
2 | //
3 | // The LLVM Compiler Infrastructure
4 | //
5 | // This file is distributed under the University of Illinois Open Source
6 | // License. See LICENSE.TXT for details.
7 | //
8 | //===----------------------------------------------------------------------===//
9 | /// \file headers.h
10 | ///
11 | /// \brief General includes for DAE
12 | ///
13 | /// \copyright Eta Scale AB. Licensed under the Eta Scale Open Source License. See
14 | /// the LICENSE file for details.
15 | //===----------------------------------------------------------------------===//
16 | #include "llvm/ADT/SmallVector.h"
17 | #include "llvm/ADT/Statistic.h"
18 | #include "llvm/Analysis/LoopPass.h"
19 | #include "llvm/Analysis/ScalarEvolution.h"
20 | #include "llvm/IR/Dominators.h"
21 | #include "llvm/Pass.h"
22 | #include "llvm/Support/CommandLine.h"
23 | #include "llvm/Support/Debug.h"
24 | #include "llvm/Support/FileSystem.h"
25 | #include "llvm/Transforms/Scalar.h"
26 | #include "llvm/Transforms/Utils/Local.h"
27 | #include "llvm/Transforms/Utils/SSAUpdater.h"
28 |
29 | #include "llvm/Analysis/LoopInfo.h"
30 | #include "llvm/IR/Argument.h"
31 | #include "llvm/IR/Attributes.h"
32 | #include "llvm/IR/BasicBlock.h"
33 | #include "llvm/IR/CallingConv.h"
34 | #include "llvm/IR/DerivedTypes.h"
35 | #include "llvm/IR/Function.h"
36 | #include "llvm/IR/GlobalValue.h"
37 | #include "llvm/IR/IRBuilder.h"
38 | #include "llvm/IR/InlineAsm.h"
39 | #include "llvm/IR/InstIterator.h"
40 | #include "llvm/IR/Instruction.h"
41 | #include "llvm/IR/Instructions.h"
42 | #include "llvm/IR/LLVMContext.h"
43 | #include "llvm/IR/Metadata.h"
44 | #include "llvm/IR/Module.h"
45 | #include "llvm/IR/Type.h"
46 | #include "llvm/Support/Compiler.h"
47 | #include "llvm/Support/raw_ostream.h"
48 |
49 | #include "llvm/IR/AssemblyAnnotationWriter.h"
50 | #include "llvm/Transforms/Utils/BasicBlockUtils.h"
51 | #include "llvm/Transforms/Utils/Cloning.h"
52 | #include
53 | #include
54 | #include
55 | #include
56 | #include
57 | #include
58 | #include
59 | #include
60 | #include
61 | #include
62 | #include
63 |
--------------------------------------------------------------------------------
/compiler/projects/include/SWOOP/Transform/SwoopDAE/BasicSwoop.h:
--------------------------------------------------------------------------------
1 | //===------- BasicSwoop.h - basic and conservative swoop ------------------===//
2 | //
3 | // The LLVM Compiler Infrastructure
4 | //
5 | // This file is distributed under the University of Illinois Open Source
6 | // License. See LICENSE.TXT for details.
7 | //
8 | //===----------------------------------------------------------------------===//
9 | /// \file BasicSwoop.h
10 | ///
11 | /// \brief Basic and conservative Swoop version.
12 | ///
13 | /// \copyright Eta Scale AB. Licensed under the Eta Scale Open Source License. See
14 | /// the LICENSE file for details.
15 | //
16 | // Basic swoop: conservatively hoisting & reusing loads.
17 | //
18 | //===----------------------------------------------------------------------===//
19 |
20 | #ifndef SWOOP_BASICSWOOP_H
21 | #define SWOOP_BASICSWOOP_H
22 |
23 | #include
24 | #include