Giter VIP home page Giter VIP logo

gsoc2018's Introduction

GSoC 2018

This repository acts as the "Work Product Submission" for my Google Summer of Code 2018 project. My project was implementing a register allocator for libjit. Register allocation is the process of determining which variables of a function reside in registers and which in memory. While working on my GSoC project I also wrote a paper which explains the theory behind writing a graph coloring based register allocator.

All my commits done during GSoC as well as the code changed can be viewed here

Work summary

  • Implement computation of the liveness sets UEVar, VarKill and LiveOut.
  • Make function prologs and epilogs on x86-64 only store the base pointer when required and only move the stack pointer when required.
  • Implement computing live ranges for each value using the computed liveness sets.
  • Extend the the rules parser to include a section with register usage information for each instruction.
  • Add internal live ranges when instructions use or clobber registers
  • Implement a graph coloring based register allocator as described by Chaitin/Briggs:
    • Build the interference graph
    • Remove nodes from the graph and pushing them on a stack
    • Pop live ranges from the stack and color them.
    • If a live range was left uncoloured in the previous step spill it and restart the process.
  • Add a flag to instructions which support a value to be in memory, so there is no need for creating a spill range for that value
  • Add a diagnostic function which dumps all live ranges of a function
  • Correctly move values into destination registers before instructions

Unimplemented

  • The orginal Chaitin Briggs allocator has an additional step which coalesces live ranges. This is currently missing in libjit.
  • In libjit there are special "manual" instructions which manually perform register operations. Currently only ARM has manual instructions. The new register allocator is untested with them.

Comparasion

This repository contains various programs and scripts for comparing the the new and old register allocators. Their execution speed is then measured and visualized.

Mandelbrot

The Mandelbrot fractal viewer is a good speed comparasion example, as it is a common program. The new allocator is approximately 35% faster.

Sum of numbers

This program sums all numbers from 0 to n. The generated code looks nearly the same with both register allocators, so there is no real difference in execution speed.

Constructed

This is a program constructed to perform better with a good register allocator. The code does not do anything useful, but contains many values and basic blocks.

gsoc2018's People

Contributors

m4gnv5 avatar

Watchers

 avatar  avatar  avatar

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.