Skip to content
This repository has been archived by the owner on May 25, 2018. It is now read-only.
Chih-Yung Liang edited this page Jun 17, 2017 · 6 revisions

Welcome to the compiler-project wiki!

  1. Clone the repository
  2. Compile the repository
$ mkdir build && cd build
$ cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_TARGETS_TO_BUILD=X86 ..
$ taskset -c 0-11 make -j24 llc
  1. Modify the Makefile is the test1 suit
  2. make the test suit, some information will be dumped here.
$ # optimized
$ make 'LLC=<Build-Dir>/bin/llc -x86-call-spill-eli -stats -debug -debug-only=x86-eliminate-call-spill' clean all
$ # baseline
$ make 'LLC=<Build-Dir>/bin/llc' clean all

The Makefile in test1 suit

LLC = llc

all: test1

test1: main.c test1.c safe_run.s
        clang test1.c -o test1.ll -S -emit-llvm
        opt -O3 test1.ll -o test1.1.ll -S
        $(LLC) -O3 test1.1.ll -o test1.s
        gcc main.c safe_run.s test1.s -o test1

run: test1
        $(PIN_ROOT)/pin -t ./InstCount.so -- ./test1

clean:
        rm -rf test1.ll test1.1.ll test1.s test1

Expected Result

Debug info & statistic

Pin tool

Clone this wiki locally