Giter VIP home page Giter VIP logo

bcdb's Introduction

The Bitcode Database (bcdb)

Tests Cachix cache standard-readme compliant

A database and infrastructure for distributed processing of LLVM bitcode.

The Bitcode Database (BCDB) is a research tool being developed as part of the ALLVM Project at UIUC. It has the following subprojects:

  • MemoDB: A content-addressable store and a memoizing distributed processing framework backed by SQLite or RocksDB. It can cache the results of various analyses and optimizations.
  • BCDB proper: Builds on MemoDB to store massive amount of LLVM bitcode and automatically deduplicate the bitcode at the function level. All the other subprojects are build on BCDB.
  • Guided Linking: A tool that can optimize dynamically linked code as though it were statically linked.
  • Outlining: A work-in-progress optimization to reduce code size using outlining.
  • SLLIM: A easy-to-use tool to apply various code size optimizations (including our outliner) to existing software without messing around with build systems.
  • Nix bitcode overlay: Nix expressions to automatically build lots of Linux packages in the form of LLVM bitcode.

Table of Contents

Background

The BCDB has been developed primarily by Sean Bartell, to support his PhD research on code size optimization.

This project initially grew out of the ALLVM Project, started by Will Dietz, which aims to explore the new possibilities that would be enabled if all software on a computer system were shipped in the form of LLVM IR. The BCDB was originally designed as a way to store massive amounts of LLVM IR more efficiently by using deduplication.

Install

mkdir build
cd build
cmake ..
make
make check

Dependencies

Building BCDB without Nix is not officially supported. If you want to try it anyway, you'll need to install these dependencies first:

  • C++ compiler with C++17 support.
  • LLVM version 11 through 14 (development versions up to 15 may work, but this is not guaranteed)
    • LLVM must be built with exception handling support. Official packages have this disabled, so you'll need to build LLVM yourself with cmake -DLLVM_ENABLE_EH=ON (or use Nix).
    • LLVM's FileCheck and not programs must be installed as well. Some packages (including some of LLVM's official packages) exclude these programs or split them off into a separate package.
    • When working on the BCDB code, you should make sure LLVM is built with assertions enabled (cmake -DLLVM_ENABLE_ASSERTIONS=ON).
  • Clang, same version as LLVM.
    • Clang doesn't need exception handling or assertions, so you can use an official Clang package.
  • CMake, at least version 3.13.
  • Libsodium
  • SQLite
  • Python, at least 3.6.
  • Boost, at least 1.75.
  • Optional dependencies:
    • RocksDB, preferably at least 6.19, with LZ4 and Zstandard support (ROCKSDB_LITE is not supported).

Building dependencies automatically with Nix

If you have Nix installed, it can automatically build BCDB along with known-working versions of its dependencies. See default.nix for the list of attributes you can build. For example:

nix-build -A bcdb
result/bin/bcdb -help

If you want to modify the BCDB code, you can instead build just the dependencies with Nix, and enter a shell that has them installed:

nix-shell -A bcdb
mkdir build
cd build
cmake ..
make

If you install and enable direnv, it will effectively set up the Nix shell every time you enter the bcdb directory.

In any case, you can speed up Nix by using our Cachix cache, which includes prebuilt versions of LLVM. Simply install Cachix and run cachix use bcdb.

Usage

See the subproject subdirectories for usage instructions and more documentation.

Maintainer

Sean Bartell.

Contributing

There's no formal process for contributing. You're welcome to submit a PR or contact [email protected].

License

Apache License 2.0 with LLVM Exceptions, copyright 2018โ€“2022 Sean Bartell and other contributors. See license in LICENSE.TXT.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.