hugo-hamet / superoptimizer

A superoptimizer implementation for a fictive programming language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🚀 superoptimizer

A superoptimizer implementation for a not-so fictive programming language called AG2 lang.

Overview

What's the idea? Really simple: optimize a -for now deterministic- program. A superoptimizer uses compiler theory algorithms to determine the best program that replicates the same output as the given program.

If you want to learn more about the subject, here are a couple of sources:

Examples

This program:

LOAD 77
SWAP 0 1
LOAD 8
XOR 0 1
SWAP 0 1
LOAD 0
SWAP 0 1

Is superoptimized as:

LOAD 69

Test the two using the ag2 compiler, I'm not lying! They have the exact same output.

About

A superoptimizer implementation for a fictive programming language.

License:MIT License


Languages

Language:C 95.2%Language:Makefile 4.8%