BEST代写-线上留学生作业代写 & 论文代写专家


C语言代写|Project 1: Warmup (LLVM)

C语言代写|Project 1: Warmup (LLVM)



• Step 1: Install and set up the environment. Git clone the repository and install LLVM and
Clang in its LLVM subfolder. (some installation tips are given later in this doc.)

• Step 2: Perform a list of small experiments with the tested program (test.c in test/phase1),

a) learn and try the basic uses of the following commands from those documentations:
Command Guide Getting Started: Building and Running Clang
clang, opt, llc, lli, llvm-link, llvm-as, llvm-dis

b) translate between different code representations using some of the above tools with
different flags.

i) source (.c) to binary (executable)
ii) source (.c) to object file (.o)
iii) source (.c) to machine assembly (.s)
iv) source (.c) to LLVM bitcode (.bc); source (.c) to LLVM IR (.ll)
v) LLVM IR (.ll) to LLVM bitcode (.bc)
vi) LLVM bitcode (.bc) to LLVM IR (.ll)
vii) LLVM IR (.ll) to machine assembly (.s)

Reference: The LLVM Compiler Infrastructure

• Step 3: Compile and run the pass HelloPass (pass/HelloPass) using opt to count the
number of predecessors and successors of each basic block of each function in the tested
program (test.c in test/phase1 docs: ProgrammersManual)

• Step 4: Write a report that lists your experiments in step-2b and step-3 with commands and
inputs/outputs. Submit your report (in PDF) along with your working folder, which includes the
temporary files you used and generated in step-2 and step-3 for the experiments (try to use
different file names so your experiment history would be preserved, instead of being